diff --git a/graphics/psdrv/escape.c b/graphics/psdrv/escape.c index 9f052af34c2..98a57ab011d 100644 --- a/graphics/psdrv/escape.c +++ b/graphics/psdrv/escape.c @@ -48,8 +48,8 @@ INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput, return 1; case QUERYESCSUPPORT: - if(cbInput != 2) { - WARN("cbInput != 2 (=%d) for QUERYESCSUPPORT\n", cbInput); + if(cbInput < 2) { + WARN("cbInput < 2 (=%d) for QUERYESCSUPPORT\n", cbInput); return 0; } else { UINT16 num = *(UINT16 *)PTR_SEG_TO_LIN(lpInData); @@ -81,10 +81,8 @@ INT PSDRV_Escape( DC *dc, INT nEscape, INT cbInput, } case SETABORTPROC: - FIXME("SETABORTPROC: Ignoring\n"); - -/* dc->w.lpfnPrint = (FARPROC16)lpInData; - */ + TRACE("SETABORTPROC\n"); + dc->w.spfnPrint = (FARPROC16)lpInData; return 1; case STARTDOC: diff --git a/graphics/win16drv/init.c b/graphics/win16drv/init.c index 2301f8d5471..f8f55fb60e0 100644 --- a/graphics/win16drv/init.c +++ b/graphics/win16drv/init.c @@ -304,7 +304,7 @@ static INT WIN16DRV_Escape( DC *dc, INT nEscape, INT cbInput, /* save the callback address and call Control with hdc as lpInData */ HDC16 *seghdc = SEGPTR_NEW(HDC16); *seghdc = dc->hSelf; - dc->w.lpfnPrint = (FARPROC16)lpInData; + dc->w.spfnPrint = (FARPROC16)lpInData; nRet = PRTDRV_Control(physDev->segptrPDEVICE, nEscape, SEGPTR_GET(seghdc), lpOutData); SEGPTR_FREE(seghdc); diff --git a/include/gdi.h b/include/gdi.h index 34459f71627..7cb509d99d2 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -127,7 +127,8 @@ typedef struct INT GraphicsMode; /* Graphics mode */ INT DCOrgX; /* DC origin */ INT DCOrgY; - FARPROC16 lpfnPrint; /* AbortProc for Printing */ + FARPROC16 spfnPrint; /* 16bit AbortProc for Printing */ + ABORTPROC lpfnPrint; /* 32bit AbortProc for Printing */ INT CursPosX; /* Current position */ INT CursPosY; INT ArcDirection; diff --git a/misc/printdrv.c b/misc/printdrv.c index 2aac7a94cb1..1a1471cc40b 100644 --- a/misc/printdrv.c +++ b/misc/printdrv.c @@ -71,6 +71,8 @@ INT16 WINAPI EndPage16( HDC16 hdc ) */ INT WINAPI StartDocA(HDC hdc ,const DOCINFOA* doc) { + TRACE("DocName = '%s' Output = '%s' Datatype = '%s'\n", + doc->lpszDocName, doc->lpszOutput, doc->lpszDatatype); return Escape(hdc, STARTDOC, strlen(doc->lpszDocName), @@ -154,10 +156,27 @@ INT WINAPI AbortDoc(HDC hdc) BOOL16 WINAPI QueryAbort16(HDC16 hdc, INT16 reserved) { DC *dc = DC_GetDCPtr( hdc ); + BOOL16 ret; - if ((!dc) || (!dc->w.lpfnPrint)) - return TRUE; - return Callbacks->CallDrvAbortProc(dc->w.lpfnPrint, hdc, 0); + if(!dc) { + ERR("Invalid hdc %04x\n", hdc); + return FALSE; + } + + if(!dc->w.lpfnPrint && !dc->w.spfnPrint) + return TRUE; + + if(dc->w.lpfnPrint && dc->w.spfnPrint) + FIXME("16 and 32 bit AbortProcs set?\n"); + + if(dc->w.spfnPrint) { + TRACE("Calling 16bit AbortProc\n"); + ret = Callbacks->CallDrvAbortProc(dc->w.spfnPrint, hdc, 0); + } else { + TRACE("Calling 32bit AbortProc\n"); + ret = dc->w.lpfnPrint(hdc,0); + } + return ret; } /********************************************************************** @@ -167,7 +186,7 @@ BOOL16 WINAPI QueryAbort16(HDC16 hdc, INT16 reserved) INT16 WINAPI SetAbortProc16(HDC16 hdc, SEGPTR abrtprc) { return Escape16(hdc, SETABORTPROC, 0, abrtprc, (SEGPTR)0); -} +} /********************************************************************** * SetAbortProc32 (GDI32.301) @@ -175,8 +194,10 @@ INT16 WINAPI SetAbortProc16(HDC16 hdc, SEGPTR abrtprc) */ INT WINAPI SetAbortProc(HDC hdc, ABORTPROC abrtprc) { - FIXME("stub\n"); - return 1; + DC *dc = DC_GetDCPtr( hdc ); + + dc->w.lpfnPrint = abrtprc; + return TRUE; } diff --git a/objects/dc.c b/objects/dc.c index 86eab9d37f5..c53cf75ad56 100644 --- a/objects/dc.c +++ b/objects/dc.c @@ -63,6 +63,7 @@ static void DC_Init_DC_INFO( WIN_DC_INFO *win_dc_info ) win_dc_info->GraphicsMode = GM_COMPATIBLE; win_dc_info->DCOrgX = 0; win_dc_info->DCOrgY = 0; + win_dc_info->spfnPrint = 0; win_dc_info->lpfnPrint = NULL; win_dc_info->CursPosX = 0; win_dc_info->CursPosY = 0;