Implement handling of 32 bit AbortProc.

This commit is contained in:
Huw D M Davies 1999-07-24 12:09:34 +00:00 committed by Alexandre Julliard
parent 3b8a724228
commit d016b0a02d
5 changed files with 35 additions and 14 deletions

View File

@ -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:

View File

@ -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);

View File

@ -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;

View File

@ -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;
}
/**********************************************************************
@ -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;
}

View File

@ -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;