- Implement SetAbortProc and halfplement AbortDoc.

svn path=/trunk/; revision=41103
This commit is contained in:
James Tabor 2009-05-24 18:04:10 +00:00
parent 487d3fb627
commit 802fba9409
2 changed files with 68 additions and 5 deletions

View File

@ -558,14 +558,50 @@ AbortDoc(
HDC hdc
)
{
PLDC pldc;
int Ret = SP_ERROR;
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
{
SetLastError(ERROR_INVALID_HANDLE);
return SP_ERROR;
}
pldc = GdiGetLDC(hdc);
if ( !pldc )
{
SetLastError(ERROR_INVALID_HANDLE);
return SP_ERROR;
}
if ( !(pldc->Flags & LDC_INIT_DOCUMENT) ) return 1;
/* winspool:DocumentEvent printer driver */
((PW32CLIENTINFO)NtCurrentTeb()->Win32ClientInfo)->cSpins = 0;
if ( pldc->Flags & LDC_META_PRINT)
{
UNIMPLEMENTED;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
return Ret;
}
if (NtGdiAbortDoc(hdc))
{
/* winspool:AbortPrinter driver */
Ret = 1;
}
else
Ret = SP_ERROR;
pldc->Flags &= ~(LDC_INFODC|LDC_META_PRINT|LDC_INIT_PAGE|LDC_INIT_DOCUMENT|LDC_SAPCALLBACK);
return Ret;
}
/*
* @unimplemented
* @implemented
*/
int
WINAPI
@ -573,9 +609,35 @@ SetAbortProc(
HDC hdc,
ABORTPROC lpAbortProc)
{
UNIMPLEMENTED;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
PLDC pldc;
ULONG hType = GDI_HANDLE_GET_TYPE(hdc);
if (hType == GDILoObjType_LO_DC_TYPE || hType == GDILoObjType_LO_METADC16_TYPE)
return SP_ERROR;
pldc = GdiGetLDC(hdc);
if ( pldc )
{
if ( lpAbortProc )
{
if ( pldc->Flags & LDC_INIT_DOCUMENT )
{
pldc->Flags |= LDC_SAPCALLBACK;
pldc->CallBackTick = GetTickCount();
}
}
else
{
pldc->Flags &= ~LDC_SAPCALLBACK;
}
pldc->pAbortProc = lpAbortProc;
return 1;
}
else
{
SetLastError(ERROR_INVALID_HANDLE);
}
return SP_ERROR;
}
/*

View File

@ -183,6 +183,7 @@
#define LDC_CLOCKWISE 0x00002000
#define LDC_KILL_DOCUMENT 0x00010000
#define LDC_META_PRINT 0x00020000
#define LDC_INFODC 0x01000000 /* If CreateIC was passed. */
#define LDC_DEVCAPS 0x02000000
/* DC_ATTR Xform Flags */