Andrew Talbot : wineps.drv: Use const-correct GetPrinterDataEx() instead of GetPrinterData().

Alexandre Julliard julliard at winehq.org
Sat Jun 21 05:39:18 CDT 2008


Module: wine
Branch: master
Commit: 901969f62483afaf249268a6f65f47b54d924279
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=901969f62483afaf249268a6f65f47b54d924279

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Fri Jun 20 17:38:38 2008 +0100

wineps.drv: Use const-correct GetPrinterDataEx() instead of GetPrinterData().

---

 dlls/wineps.drv/init.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c
index 5b85c45..61e31d8 100644
--- a/dlls/wineps.drv/init.c
+++ b/dlls/wineps.drv/init.c
@@ -538,7 +538,6 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
     char* ppdFileName = NULL;
     HKEY hkey;
     BOOL using_default_devmode = FALSE;
-    static CHAR paper_size[] = "Paper Size";
 
     TRACE("'%s'\n", name);
 
@@ -606,12 +605,11 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
     }
 #endif
     if (!ppdFileName) {
-        static CHAR ppd_file[] = "PPD File";
-
-        res = GetPrinterDataA(hPrinter, ppd_file, NULL, NULL, 0, &needed);
+        res = GetPrinterDataExA(hPrinter, "PrinterDriverData", "PPD File", NULL, NULL, 0, &needed);
         if ((res==ERROR_SUCCESS) || (res==ERROR_MORE_DATA)) {
             ppdFileName=HeapAlloc(PSDRV_Heap, 0, needed);
-            res = GetPrinterDataA(hPrinter, ppd_file, &ppdType, (LPBYTE)ppdFileName, needed, &needed);
+            res = GetPrinterDataExA(hPrinter, "PrinterDriverData", "PPD File", &ppdType,
+                                    (LPBYTE)ppdFileName, needed, &needed);
         }
     }
     /* Look for a ppd file for this printer in the config file.
@@ -706,8 +704,8 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
      *	the Devmode structure, but Wine doesn't currently provide a convenient
      *	way to configure printers.
      */
-    res = GetPrinterDataA (hPrinter, paper_size, NULL, (LPBYTE) &dwPaperSize,
-	    sizeof (DWORD), &needed);
+    res = GetPrinterDataExA(hPrinter, "PrinterDriverData", "Paper Size", NULL,
+                            (LPBYTE)&dwPaperSize, sizeof(DWORD), &needed);
     if (res == ERROR_SUCCESS)
 	pi->Devmode->dmPublic.u1.s1.dmPaperSize = (SHORT) dwPaperSize;
     else if (res == ERROR_FILE_NOT_FOUND)




More information about the wine-cvs mailing list