From 6a37552f9ef43660d00451f5fefaf10a00597b67 Mon Sep 17 00:00:00 2001 From: Saveliy Tretiakov Date: Sun, 10 Sep 2006 19:42:09 +0000 Subject: [PATCH] implement NtGdiPathToRegion svn path=/trunk/; revision=24042 --- .../subsystems/win32/win32k/objects/path.c | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/path.c b/reactos/subsystems/win32/win32k/objects/path.c index fe7b3150708..40f08085ec9 100644 --- a/reactos/subsystems/win32/win32k/objects/path.c +++ b/reactos/subsystems/win32/win32k/objects/path.c @@ -252,8 +252,31 @@ HRGN STDCALL NtGdiPathToRegion(HDC hDC) { - UNIMPLEMENTED; - return 0; + GdiPath *pPath; + HRGN hrgnRval = 0; + DC *pDc; + + DPRINT("Enter %s\n", __FUNCTION__); + + pDc = DC_LockDc(hDC); + if(!pDc) return NULL; + + pPath = &pDc->w.path; + + if(pPath->state!=PATH_Closed) + { + //FIXME: check that setlasterror is being called correctly + SetLastWin32Error(ERROR_CAN_NOT_COMPLETE); + } + else + { + /* FIXME: Should we empty the path even if conversion failed? */ + if(PATH_PathToRegion(pPath, pDc->w.polyFillMode, &hrgnRval)) + PATH_EmptyPath(pPath); + } + + DC_UnlockDc(pDc); + return hrgnRval; } BOOL