From a784e30920fea2f58294cdc2b3878e22f53fddf6 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sun, 1 Mar 2009 19:37:52 +0000 Subject: [PATCH] - Implement GdiIsMetaFileDC and GdiIsMetaPrintDC. svn path=/trunk/; revision=39835 --- reactos/dll/win32/gdi32/misc/stubs.c | 47 ++++++++++++++++++----- reactos/include/reactos/win32k/ntgdihdl.h | 1 + 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index 7ca0c7dd1c6..2291f574950 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -1097,27 +1097,54 @@ GdiDrawStream(HDC dc, ULONG l, VOID *v) } /* - * @unimplemented + * @implemented */ BOOL WINAPI -GdiIsMetaFileDC(HDC hdc) +GdiIsMetaFileDC(HDC hDC) { - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return TRUE; + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if ( pLDC->iType == LDC_EMFLDC) return TRUE; + } + } + return FALSE; } /* - * @unimplemented + * @implemented */ BOOL WINAPI -GdiIsMetaPrintDC(HDC hdc) +GdiIsMetaPrintDC(HDC hDC) { - UNIMPLEMENTED; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + + if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return FALSE; + else + { + PLDC pLDC = GdiGetLDC(hDC); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if ( pLDC->Flags & LDC_META_PRINT) return TRUE; + } + } + return FALSE; } /* diff --git a/reactos/include/reactos/win32k/ntgdihdl.h b/reactos/include/reactos/win32k/ntgdihdl.h index e6fe3074c2a..49a7283fc36 100644 --- a/reactos/include/reactos/win32k/ntgdihdl.h +++ b/reactos/include/reactos/win32k/ntgdihdl.h @@ -178,6 +178,7 @@ #define LDC_INIT_PAGE 0x00000080 #define LDC_CLOCKWISE 0x00002000 #define LDC_KILL_DOCUMENT 0x00010000 +#define LDC_META_PRINT 0x00020000 #define LDC_DEVCAPS 0x02000000 /* DC_ATTR Xform Flags */