PATCH: printing deadlock

Marcus Meissner marcus at jet.franken.de
Sat Aug 18 07:18:18 CDT 2001


Hi,

notepad.exe always spews dozens of 'potential deadlock' during printing
and now dumps into the debugger.

Reason is that EndDoc() calls QueryAbort16(), which calls the ABORTDOC
proc with GDI lock held.

This patch addresses that problem, but I am not sure if it is 
correct.

Ciao, Marcus

Changelog:
	Do not hold the GDI lock when the ABORTDOC procedure is called.

Index: printdrv.c
===================================================================
RCS file: /home/wine/wine/dlls/gdi/printdrv.c,v
retrieving revision 1.16
diff -u -r1.16 printdrv.c
--- printdrv.c	2001/07/29 20:25:14	1.16
+++ printdrv.c	2001/08/18 12:15:46
@@ -230,14 +230,18 @@
 {
     BOOL ret = TRUE;
     DC *dc = DC_GetDCPtr( hdc );
+    ABORTPROC	abproc;
 
     if(!dc) {
         ERR("Invalid hdc %04x\n", hdc);
 	return FALSE;
     }
 
-    if (dc->pAbortProc) ret = dc->pAbortProc(hdc, 0);
+    abproc = dc->pAbortProc;
     GDI_ReleaseObj( hdc );
+
+    if (abproc)
+	ret = abproc(hdc, 0);
     return ret;
 }
 




More information about the wine-patches mailing list