Author: jimtabor
Date: Sun May 24 22:04:10 2009
New Revision: 41103
URL:
http://svn.reactos.org/svn/reactos?rev=41103&view=rev
Log:
- Implement SetAbortProc and halfplement AbortDoc.
Modified:
trunk/reactos/dll/win32/gdi32/misc/stubs.c
trunk/reactos/include/reactos/win32k/ntgdihdl.h
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Sun May 24 22:04:10 2009
@@ -558,14 +558,50 @@
HDC hdc
)
{
- UNIMPLEMENTED;
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-
-/*
- * @unimplemented
+ 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 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;
+}
+
+
+/*
+ * @implemented
*/
int
WINAPI
@@ -573,9 +609,35 @@
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;
}
/*
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntgdihdl.h [iso-8859-1] Sun May 24 22:04:10 2009
@@ -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 */