Jacek Caban : gdi32: Store abort proc in DC_ATTR.

Alexandre Julliard julliard at winehq.org
Thu Sep 2 15:45:30 CDT 2021


Module: wine
Branch: master
Commit: 711ce415c01a5e36bde6bb147b5aa3cedc8b35ed
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=711ce415c01a5e36bde6bb147b5aa3cedc8b35ed

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Sep  2 14:14:25 2021 +0200

gdi32: Store abort proc in DC_ATTR.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/gdidc.c         | 12 ++++++++++++
 dlls/gdi32/ntgdi_private.h |  1 -
 dlls/gdi32/printdrv.c      | 17 +----------------
 include/ntgdi.h            |  1 +
 4 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c
index f175d8f59bc..0f01e28696d 100644
--- a/dlls/gdi32/gdidc.c
+++ b/dlls/gdi32/gdidc.c
@@ -1821,6 +1821,18 @@ BOOL WINAPI CancelDC(HDC hdc)
     return TRUE;
 }
 
+/**********************************************************************
+ *           SetAbortProc   (GDI32.@)
+ */
+INT WINAPI SetAbortProc( HDC hdc, ABORTPROC abrtprc )
+{
+    DC_ATTR *dc_attr;
+
+    if (!(dc_attr = get_dc_attr( hdc ))) return FALSE;
+    dc_attr->abort_proc = abrtprc;
+    return TRUE;
+}
+
 /***********************************************************************
  *           SetICMMode    (GDI32.@)
  */
diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h
index 6701385784f..c2e45ab7ce0 100644
--- a/dlls/gdi32/ntgdi_private.h
+++ b/dlls/gdi32/ntgdi_private.h
@@ -101,7 +101,6 @@ typedef struct tagDC
 
     INT           breakExtra;        /* breakTotalExtra / breakCount */
     INT           breakRem;          /* breakTotalExtra % breakCount */
-    ABORTPROC     pAbortProc;        /* AbortProc for Printing */
     XFORM         xformWorld2Wnd;    /* World-to-window transformation */
     XFORM         xformWorld2Vport;  /* World-to-viewport transformation */
     XFORM         xformVport2World;  /* Inverse of the above transformation */
diff --git a/dlls/gdi32/printdrv.c b/dlls/gdi32/printdrv.c
index c4fcf8ada13..ee8ae295daf 100644
--- a/dlls/gdi32/printdrv.c
+++ b/dlls/gdi32/printdrv.c
@@ -76,7 +76,7 @@ INT WINAPI StartDocW(HDC hdc, const DOCINFOW* doc)
 
     if(!dc) return SP_ERROR;
 
-    if (dc->pAbortProc && !dc->pAbortProc( hdc, 0 )) ret = 0;
+    if (dc->attr->abort_proc && !dc->attr->abort_proc( hdc, 0 )) ret = 0;
     else
     {
         PHYSDEV physdev = GET_DC_PHYSDEV( dc, pStartDoc );
@@ -204,18 +204,3 @@ INT WINAPI AbortDoc(HDC hdc)
     }
     return ret;
 }
-
-
-/**********************************************************************
- *           SetAbortProc   (GDI32.@)
- *
- */
-INT WINAPI SetAbortProc(HDC hdc, ABORTPROC abrtprc)
-{
-    DC *dc = get_dc_ptr( hdc );
-
-    if (!dc) return FALSE;
-    dc->pAbortProc = abrtprc;
-    release_dc_ptr( dc );
-    return TRUE;
-}
diff --git a/include/ntgdi.h b/include/ntgdi.h
index 061ed40779c..8bff1d4338f 100644
--- a/include/ntgdi.h
+++ b/include/ntgdi.h
@@ -169,6 +169,7 @@ typedef struct DC_ATTR
     UINT      font_code_page;
     RECTL     emf_bounds;
     void     *emf;
+    ABORTPROC abort_proc;          /* AbortProc for printing */
 } DC_ATTR;
 
 struct font_enum_entry




More information about the wine-cvs mailing list