Author: jimtabor
Date: Sun May 24 08:07:47 2009
New Revision: 41091
URL:
http://svn.reactos.org/svn/reactos?rev=41091&view=rev
Log:
- Implement GdiConvertAndCheckDC and Abort callback support routine.
Modified:
trunk/reactos/dll/win32/gdi32/include/gdi32p.h
trunk/reactos/dll/win32/gdi32/misc/misc.c
trunk/reactos/dll/win32/gdi32/misc/stubs.c
trunk/reactos/include/reactos/win32k/ntgdihdl.h
Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/include/gd…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] Sun May 24 08:07:47 2009
@@ -30,6 +30,8 @@
#define METAFILE_MEMORY 1
#define METAFILE_DISK 2
+
+#define SAPCALLBACKDELAY 244
/* MACRO ********************************************************************/
@@ -238,4 +240,6 @@
WINAPI
GdiGetBitmapBitsSize(BITMAPINFO *lpbmi);
+VOID GdiSAPCallback(PLDC pldc);
+
/* EOF */
Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/misc.…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/misc/misc.c [iso-8859-1] Sun May 24 08:07:47 2009
@@ -164,6 +164,23 @@
return Dc_Attr->pvLDC;
}
+VOID GdiSAPCallback(PLDC pldc)
+{
+ DWORD Time, NewTime = GetTickCount();
+
+ Time = NewTime - pldc->CallBackTick;
+
+ if ( Time < SAPCALLBACKDELAY) return;
+
+ pldc->CallBackTick = NewTime;
+
+ if ( pldc->pAbortProc(pldc->hDC, 0) )
+ {
+ CancelDC(pldc->hDC);
+ AbortDoc(pldc->hDC);
+ }
+}
+
/*
* @implemented
*/
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 08:07:47 2009
@@ -1142,15 +1142,26 @@
}
/*
- * @unimplemented
+ * @implemented
*/
HDC
WINAPI
GdiConvertAndCheckDC(HDC hdc)
{
- 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 hdc;
+ pldc = GdiGetLDC(hdc);
+ if (pldc)
+ {
+ if (pldc->Flags & LDC_SAPCALLBACK) GdiSAPCallback(pldc);
+ if (pldc->Flags & LDC_KILL_DOCUMENT) return NULL;
+ if (pldc->Flags & LDC_STARTPAGE) StartPage(hdc);
+ return hdc;
+ }
+ SetLastError(ERROR_INVALID_HANDLE);
+ return NULL;
}
/*
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 08:07:47 2009
@@ -178,6 +178,7 @@
#define LDC_SAPCALLBACK 0x00000020
#define LDC_INIT_DOCUMENT 0x00000040
#define LDC_INIT_PAGE 0x00000080
+#define LDC_STARTPAGE 0x00000100
#define LDC_PLAY_MFDC 0x00000800
#define LDC_CLOCKWISE 0x00002000
#define LDC_KILL_DOCUMENT 0x00010000