[PATCH v2] winspool.drv: If the call to cupsPrintFile fails, print the cups error message.

Jeremy White jwhite at codeweavers.com
Wed Jan 27 08:58:26 CST 2016


Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
v2: Use debugstr_a for print format.
---
 dlls/winspool.drv/info.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index cebf6f7..89966ce 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -781,6 +781,7 @@ static void *cupshandle;
     DO_FUNC(cupsPrintFile)
 #define CUPS_OPT_FUNCS \
     DO_FUNC(cupsGetNamedDest); \
+    DO_FUNC(cupsLastErrorString); \
     DO_FUNC(cupsGetPPD3)
 
 #define DO_FUNC(f) static typeof(f) *p##f
@@ -788,6 +789,7 @@ CUPS_FUNCS;
 #undef DO_FUNC
 static cups_dest_t * (*pcupsGetNamedDest)(http_t *, const char *, const char *);
 static http_status_t (*pcupsGetPPD3)(http_t *, const char *, time_t *, char *, size_t);
+static const char *  (*pcupsLastErrorString)(void);
 
 static http_status_t cupsGetPPD3_wrapper( http_t *http, const char *name,
                                           time_t *modtime, char *buffer,
@@ -8237,6 +8239,8 @@ static BOOL schedule_cups(LPCWSTR printer_name, LPCWSTR filename, LPCWSTR docume
             TRACE( "\t%d: %s = %s\n", i, options[i].name, options[i].value );
 
         ret = pcupsPrintFile( queue, unixname, unix_doc_title, num_options, options );
+        if (ret == 0 && pcupsLastErrorString)
+            WARN("cupsPrintFile failed with error %s\n", debugstr_a(pcupsLastErrorString()));
 
         pcupsFreeOptions( num_options, options );
 
-- 
2.1.4




More information about the wine-patches mailing list