Commit d016b0a0 authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

Implement handling of 32 bit AbortProc.

parent 3b8a7242
......@@ -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:
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment