ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
December 2014
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
387 discussions
Start a n
N
ew thread
[tkreuzer] 65886: [WIN32K] Implement GdiGetEMFRestorDc case in NtGdiGetDCDword
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:12:10 2014 New Revision: 65886 URL:
http://svn.reactos.org/svn/reactos?rev=65886&view=rev
Log: [WIN32K] Implement GdiGetEMFRestorDc case in NtGdiGetDCDword Modified: trunk/reactos/win32ss/gdi/ntgdi/dcutil.c Modified: trunk/reactos/win32ss/gdi/ntgdi/dcutil.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcutil.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] Mon Dec 29 13:12:10 2014 @@ -429,6 +429,7 @@ break; case GdiGetEMFRestorDc: + SafeResult = pdc->dclevel.lSaveDepth; break; case GdiGetFontLanguageInfo:
9 years, 12 months
1
0
0
0
[tkreuzer] 65885: [WIN32K] - Implement GreCreateCompatibleDC, allowing to pass in a boolean value, specifying the DC type (normal or "alternative" DC, aka metafile DC) - Properly implement NtGdiCre...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:12:05 2014 New Revision: 65885 URL:
http://svn.reactos.org/svn/reactos?rev=65885&view=rev
Log: [WIN32K] - Implement GreCreateCompatibleDC, allowing to pass in a boolean value, specifying the DC type (normal or "alternative" DC, aka metafile DC) - Properly implement NtGdiCreateMetafileDC around GreCreateCompatibleDC Modified: trunk/reactos/win32ss/gdi/ntgdi/dc.h trunk/reactos/win32ss/gdi/ntgdi/dclife.c trunk/reactos/win32ss/gdi/ntgdi/dcstate.c trunk/reactos/win32ss/gdi/ntgdi/metafile.c Modified: trunk/reactos/win32ss/gdi/ntgdi/dc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dc.h?rev…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dc.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dc.h [iso-8859-1] Mon Dec 29 13:12:05 2014 @@ -182,7 +182,7 @@ INIT_FUNCTION NTSTATUS NTAPI InitDcImpl(VOID); PPDEVOBJ FASTCALL IntEnumHDev(VOID); -PDC NTAPI DC_AllocDcWithHandle(VOID); +PDC NTAPI DC_AllocDcWithHandle(GDILOOBJTYPE eDcObjType); BOOL NTAPI DC_bAllocDcAttr(PDC pdc); VOID NTAPI DC_vCleanup(PVOID ObjectBody); BOOL FASTCALL IntGdiDeleteDC(HDC, BOOL); @@ -205,6 +205,7 @@ VOID FASTCALL IntvGetDeviceCaps(PPDEVOBJ, PDEVCAPS); BOOL NTAPI GreSetDCOwner(HDC hdc, ULONG ulOwner); +HDC APIENTRY GreCreateCompatibleDC(HDC hdc, BOOL bAltDc); VOID NTAPI @@ -219,7 +220,8 @@ pdc = GDIOBJ_LockObject(hdc, GDIObjType_DC_TYPE); if (pdc) { - ASSERT(GDI_HANDLE_GET_TYPE(pdc->BaseObject.hHmgr) == GDILoObjType_LO_DC_TYPE); + ASSERT((GDI_HANDLE_GET_TYPE(pdc->BaseObject.hHmgr) == GDILoObjType_LO_DC_TYPE) || + (GDI_HANDLE_GET_TYPE(pdc->BaseObject.hHmgr) == GDILoObjType_LO_ALTDC_TYPE)); ASSERT(pdc->dclevel.plfnt != NULL); ASSERT(GDI_HANDLE_GET_TYPE(((POBJ)pdc->dclevel.plfnt)->hHmgr) == GDILoObjType_LO_FONT_TYPE); } Modified: trunk/reactos/win32ss/gdi/ntgdi/dclife.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dclife.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] Mon Dec 29 13:12:05 2014 @@ -66,10 +66,14 @@ PDC NTAPI -DC_AllocDcWithHandle() +DC_AllocDcWithHandle(GDILOOBJTYPE eDcObjType) { PDC pdc; + NT_ASSERT((eDcObjType == GDILoObjType_LO_DC_TYPE) || + (eDcObjType == GDILoObjType_LO_ALTDC_TYPE)); + + /* Allocate the object */ pdc = (PDC)GDIOBJ_AllocateObject(GDIObjType_DC_TYPE, sizeof(DC), BASEFLAG_LOOKASIDE); @@ -79,6 +83,10 @@ return NULL; } + /* Set the actual DC type */ + pdc->BaseObject.hHmgr = UlongToHandle(eDcObjType); + + /* Insert the object */ if (!GDIOBJ_hInsertObject(&pdc->BaseObject, GDI_OBJ_HMGR_POWNED)) { DPRINT1("Could not insert DC into handle table.\n"); @@ -95,6 +103,15 @@ void DC_InitHack(PDC pdc) { + if (defaultDCstate == NULL) + { + defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC); + ASSERT(defaultDCstate); + RtlZeroMemory(defaultDCstate, sizeof(DC)); + defaultDCstate->pdcattr = &defaultDCstate->dcattr; + DC_vCopyState(pdc, defaultDCstate, TRUE); + } + TextIntRealizeFont(pdc->pdcattr->hlfntNew,NULL); pdc->pdcattr->iCS_CP = ftGdiGetTextCharsetInfo(pdc,NULL,0); @@ -327,15 +344,6 @@ pdc->dcattr.iGraphicsMode = GM_COMPATIBLE; pdc->dcattr.iCS_CP = 0; pdc->pSurfInfo = NULL; - - if (defaultDCstate == NULL) - { - defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC); - ASSERT(defaultDCstate); - RtlZeroMemory(defaultDCstate, sizeof(DC)); - defaultDCstate->pdcattr = &defaultDCstate->dcattr; - DC_vCopyState(pdc, defaultDCstate, TRUE); - } } VOID @@ -631,7 +639,7 @@ DPRINT("GreOpenDCW - ppdev = %p\n", ppdev); - pdc = DC_AllocDcWithHandle(); + pdc = DC_AllocDcWithHandle(GDILoObjType_LO_DC_TYPE); if (!pdc) { DPRINT1("Could not Allocate a DC\n"); @@ -755,8 +763,9 @@ HDC APIENTRY -NtGdiCreateCompatibleDC(HDC hdc) -{ +GreCreateCompatibleDC(HDC hdc, BOOL bAltDc) +{ + GDILOOBJTYPE eDcObjType; HDC hdcNew; PPDEVOBJ ppdev; PDC pdc, pdcNew; @@ -794,7 +803,8 @@ } /* Allocate a new DC */ - pdcNew = DC_AllocDcWithHandle(); + eDcObjType = bAltDc ? GDILoObjType_LO_ALTDC_TYPE : GDILoObjType_LO_DC_TYPE; + pdcNew = DC_AllocDcWithHandle(eDcObjType); if (!pdcNew) { DPRINT1("Could not allocate a new DC\n"); @@ -804,7 +814,7 @@ hdcNew = pdcNew->BaseObject.hHmgr; /* Lock ppdev and initialize the new DC */ - DC_vInitDc(pdcNew, DCTYPE_MEMORY, ppdev); + DC_vInitDc(pdcNew, bAltDc ? DCTYPE_INFO : DCTYPE_MEMORY, ppdev); /* FIXME: HACK! */ DC_InitHack(pdcNew); @@ -816,6 +826,14 @@ DPRINT("Leave NtGdiCreateCompatibleDC hdcNew = %p\n", hdcNew); return hdcNew; +} + +HDC +APIENTRY +NtGdiCreateCompatibleDC(HDC hdc) +{ + /* Call the internal function to create a normal memory DC */ + return GreCreateCompatibleDC(hdc, FALSE); } BOOL Modified: trunk/reactos/win32ss/gdi/ntgdi/dcstate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcstate.…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dcstate.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dcstate.c [iso-8859-1] Mon Dec 29 13:12:05 2014 @@ -262,7 +262,7 @@ } /* Allocate a new dc */ - pdcSave = DC_AllocDcWithHandle(); + pdcSave = DC_AllocDcWithHandle(GDILoObjType_LO_DC_TYPE); if (pdcSave == NULL) { DPRINT("Could not allocate a new DC\n"); Modified: trunk/reactos/win32ss/gdi/ntgdi/metafile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/metafile…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/metafile.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/metafile.c [iso-8859-1] Mon Dec 29 13:12:05 2014 @@ -34,23 +34,8 @@ APIENTRY NtGdiCreateMetafileDC(IN HDC hdc) { - PDC pDc; - HDC ret = NULL; - - if (hdc) - { - pDc = DC_LockDc(hdc); - if (pDc) - { // Not sure this is right for getting the HDEV handle, maybe Timo could help or just if'ed it out. - ret = IntGdiCreateDisplayDC(pDc->ppdev->BaseObject.hHmgr, DC_TYPE_INFO, TRUE); - DC_UnlockDc(pDc); - } - } - else - { - ret = UserGetDesktopDC(DC_TYPE_INFO, TRUE, FALSE); - } - return ret; + /* Call the internal function to create an alternative info DC */ + return GreCreateCompatibleDC(hdc, TRUE); } /* @@ -68,7 +53,7 @@ UNIMPLEMENTED; return NULL; } - + /* * @unimplemented */
9 years, 12 months
1
0
0
0
[tkreuzer] 65884: [WIN32K] - Implement NtGdiGetObjectBitmapHandle - Set BR_IS_DIBPALCOLORS in IntGdiCreateDIBBrush
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:11:59 2014 New Revision: 65884 URL:
http://svn.reactos.org/svn/reactos?rev=65884&view=rev
Log: [WIN32K] - Implement NtGdiGetObjectBitmapHandle - Set BR_IS_DIBPALCOLORS in IntGdiCreateDIBBrush Modified: trunk/reactos/win32ss/gdi/eng/stubs.c trunk/reactos/win32ss/gdi/ntgdi/brush.c Modified: trunk/reactos/win32ss/gdi/eng/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/stubs.c?re…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/stubs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/stubs.c [iso-8859-1] Mon Dec 29 13:11:59 2014 @@ -923,18 +923,6 @@ return FALSE; } -/* - * @unimplemented - */ -HBRUSH -APIENTRY -NtGdiClearBrushAttributes( - IN HBRUSH hbm, - IN DWORD dwFlags) -{ - UNIMPLEMENTED; - return NULL; -} /* * @unimplemented @@ -1259,19 +1247,6 @@ /* * @unimplemented */ -HBITMAP -APIENTRY -NtGdiGetObjectBitmapHandle( - IN HBRUSH hbr, - OUT UINT *piUsage) -{ - UNIMPLEMENTED; - return 0; -} - -/* - * @unimplemented - */ BOOL APIENTRY NtGdiGetMonitorID( @@ -1408,19 +1383,6 @@ { UNIMPLEMENTED; return 0; -} - -/* - * @unimplemented - */ -HBRUSH -APIENTRY -NtGdiSetBrushAttributes( - IN HBRUSH hbm, - IN DWORD dwFlags) -{ - UNIMPLEMENTED; - return NULL; } /* Modified: trunk/reactos/win32ss/gdi/ntgdi/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/brush.c?…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/brush.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/brush.c [iso-8859-1] Mon Dec 29 13:11:59 2014 @@ -200,10 +200,10 @@ HBRUSH APIENTRY IntGdiCreateDIBBrush( - CONST BITMAPINFO *BitmapInfo, - UINT ColorSpec, + const BITMAPINFO *BitmapInfo, + UINT uUsage, UINT BitmapInfoSize, - CONST VOID *PackedDIB) + const VOID* pvClient) { HBRUSH hBrush; PBRUSH pbrush; @@ -217,9 +217,9 @@ return NULL; } - DataPtr = (ULONG_PTR)BitmapInfo + DIB_BitmapInfoSize(BitmapInfo, ColorSpec); - - hPattern = DIB_CreateDIBSection(NULL, BitmapInfo, ColorSpec, &pvDIBits, NULL, 0, 0); + DataPtr = (ULONG_PTR)BitmapInfo + DIB_BitmapInfoSize(BitmapInfo, uUsage); + + hPattern = DIB_CreateDIBSection(NULL, BitmapInfo, uUsage, &pvDIBits, NULL, 0, 0); if (hPattern == NULL) { EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); @@ -241,8 +241,10 @@ hBrush = pbrush->BaseObject.hHmgr; pbrush->flAttrs |= BR_IS_BITMAP | BR_IS_DIB; + if (uUsage == DIB_PAL_COLORS) + pbrush->flAttrs |= BR_IS_DIBPALCOLORS; pbrush->hbmPattern = hPattern; - pbrush->hbmClient = (HBITMAP)PackedDIB; + pbrush->hbmClient = (HBITMAP)pvClient; /* FIXME: Fill in the rest of fields!!! */ GreSetObjectOwner(hPattern, GDI_OBJ_HMGR_PUBLIC); @@ -460,5 +462,76 @@ return IntGdiCreateSolidBrush(Color); } +HBITMAP +APIENTRY +NtGdiGetObjectBitmapHandle( + _In_ HBRUSH hbr, + _Out_ UINT *piUsage) +{ + HBITMAP hbmPattern; + PBRUSH pbr; + + /* Lock the brush */ + pbr = BRUSH_ShareLockBrush(hbr); + if (pbr == NULL) + { + DPRINT1("Could not lock brush\n"); + return NULL; + } + + /* Get the pattern bitmap handle */ + hbmPattern = pbr->hbmPattern; + + _SEH2_TRY + { + ProbeForWrite(piUsage, sizeof(*piUsage), sizeof(*piUsage)); + + /* Set usage according to flags */ + if (pbr->flAttrs & BR_IS_DIBPALCOLORS) + *piUsage = DIB_PAL_COLORS; + else + *piUsage = DIB_RGB_COLORS; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + DPRINT1("Got exception!\n"); + hbmPattern = NULL; + } + _SEH2_END; + + /* Unlock the brush */ + BRUSH_ShareUnlockBrush(pbr); + + /* Return the pattern bitmap handle */ + return hbmPattern; +} + +/* + * @unimplemented + */ +HBRUSH +APIENTRY +NtGdiSetBrushAttributes( + IN HBRUSH hbm, + IN DWORD dwFlags) +{ + UNIMPLEMENTED; + return NULL; +} + + +/* + * @unimplemented + */ +HBRUSH +APIENTRY +NtGdiClearBrushAttributes( + IN HBRUSH hbr, + IN DWORD dwFlags) +{ + UNIMPLEMENTED; + return NULL; +} + /* EOF */
9 years, 12 months
1
0
0
0
[tkreuzer] 65883: [GDI32] In DeleteObject handle ALTDC type, factor out GdiDeleteBrushOrPen, improve code a bit
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:11:54 2014 New Revision: 65883 URL:
http://svn.reactos.org/svn/reactos?rev=65883&view=rev
Log: [GDI32] In DeleteObject handle ALTDC type, factor out GdiDeleteBrushOrPen, improve code a bit Modified: trunk/reactos/win32ss/gdi/gdi32/objects/gdiobj.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/gdiobj.c [iso-8859-1] Mon Dec 29 13:11:54 2014 @@ -276,84 +276,92 @@ return cbResult; } - -/* - * @implemented - */ +static BOOL +GdiDeleteBrushOrPen( + HGDIOBJ hobj) +{ + GDILOOBJTYPE eObjectType; + PBRUSH_ATTR pbrattr; + PTEB pTeb; + PGDIBSOBJECT pgO; + + eObjectType = GDI_HANDLE_GET_TYPE(hobj); + + if ((GdiGetHandleUserData(hobj, eObjectType, (PVOID*)&pbrattr)) && + (pbrattr != NULL)) + { + pTeb = NtCurrentTeb(); + if (pTeb->Win32ThreadInfo != NULL) + { + pgO = GdiAllocBatchCommand(NULL, GdiBCDelObj); + if (pgO) + { + /// FIXME: we need to mark the object as deleted! + pgO->hgdiobj = hobj; + return TRUE; + } + } + } + + return NtGdiDeleteObjectApp(hobj); +} + +/* + * @implemented + */ +BOOL WINAPI DeleteObject(HGDIOBJ hObject) { - DWORD dwType = 0; - - /* From Wine: DeleteObject does not SetLastError() on a null object */ - if(!hObject) return FALSE; - - if ((DWORD)hObject & GDI_HANDLE_STOCK_MASK) - { - // Relax! This is a normal return! + /* Check if the handle is valid (FIXME: we need some special + sauce for the stock object flag) */ + if (!GdiIsHandleValid(hObject)) + return FALSE; + + /* Check if this is a stock object */ + if ((DWORD_PTR)hObject & GDI_HANDLE_STOCK_MASK) + { + /* Ignore the attempt to delete a stock object */ DPRINT("Trying to delete system object 0x%p\n", hObject); return TRUE; } - // If you dont own it?! Get OUT! - if(!GdiIsHandleValid(hObject)) return FALSE; - - dwType = GDI_HANDLE_GET_TYPE(hObject); - - if ((dwType == GDI_OBJECT_TYPE_METAFILE) || - (dwType == GDI_OBJECT_TYPE_ENHMETAFILE)) - return FALSE; - - switch (dwType) - { - case GDI_OBJECT_TYPE_DC: - return DeleteDC((HDC) hObject); - case GDI_OBJECT_TYPE_COLORSPACE: - return NtGdiDeleteColorSpace((HCOLORSPACE) hObject); - case GDI_OBJECT_TYPE_REGION: - return DeleteRegion((HRGN) hObject); + /* Switch by object type */ + switch (GDI_HANDLE_GET_TYPE(hObject)) + { + case GDILoObjType_LO_METAFILE16_TYPE: + case GDILoObjType_LO_METAFILE_TYPE: + return FALSE; + + case GDILoObjType_LO_DC_TYPE: + case GDILoObjType_LO_ALTDC_TYPE: + return DeleteDC(hObject); + + case GDILoObjType_LO_ICMLCS_TYPE: + return NtGdiDeleteColorSpace(hObject); + + case GDILoObjType_LO_REGION_TYPE: + return DeleteRegion(hObject); #if 0 - case GDI_OBJECT_TYPE_METADC: - return MFDRV_DeleteObject( hObject ); - case GDI_OBJECT_TYPE_EMF: - { - PLDC pLDC = GdiGetLDC(hObject); - if ( !pLDC ) return FALSE; - return EMFDRV_DeleteObject( hObject ); - } + case GDI_OBJECT_TYPE_METADC: + return MFDRV_DeleteObject( hObject ); + case GDI_OBJECT_TYPE_EMF: + { + PLDC pLDC = GdiGetLDC(hObject); + if ( !pLDC ) return FALSE; + return EMFDRV_DeleteObject( hObject ); + } #endif - case GDI_OBJECT_TYPE_FONT: - break; - - case GDI_OBJECT_TYPE_BRUSH: - case GDI_OBJECT_TYPE_EXTPEN: - case GDI_OBJECT_TYPE_PEN: - { - PBRUSH_ATTR Brh_Attr; - PTEB pTeb; - PGDIBSOBJECT pgO; - - if ((!GdiGetHandleUserData(hObject, dwType, (PVOID*)&Brh_Attr)) || - (Brh_Attr == NULL)) break; - - pTeb = NtCurrentTeb(); - - if (pTeb->Win32ThreadInfo == NULL) break; - - pgO = GdiAllocBatchCommand(NULL, GdiBCDelObj); - if (pgO) - { - pgO->hgdiobj = hObject; - return TRUE; - } - - break; - } - - case GDI_OBJECT_TYPE_BITMAP: - default: - break; + case GDILoObjType_LO_BRUSH_TYPE: + case GDILoObjType_LO_PEN_TYPE: + case GDILoObjType_LO_EXTPEN_TYPE: + return GdiDeleteBrushOrPen(hObject); + + case GDILoObjType_LO_FONT_TYPE: + case GDILoObjType_LO_BITMAP_TYPE: + default: + break; } return NtGdiDeleteObjectApp(hObject);
9 years, 12 months
1
0
0
0
[tkreuzer] 65882: [GDI32] Improve client object code
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:11:48 2014 New Revision: 65882 URL:
http://svn.reactos.org/svn/reactos?rev=65882&view=rev
Log: [GDI32] Improve client object code Modified: trunk/reactos/win32ss/gdi/gdi32/include/gdi32p.h trunk/reactos/win32ss/gdi/gdi32/objects/clientobj.c Modified: trunk/reactos/win32ss/gdi/gdi32/include/gdi32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/include/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/include/gdi32p.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/include/gdi32p.h [iso-8859-1] Mon Dec 29 13:11:48 2014 @@ -446,18 +446,32 @@ HGDIOBJ WINAPI -GdiInsertClientObj( +GdiCreateClientObj( _In_ PVOID pvObject, _In_ GDILOOBJTYPE eObjType); PVOID WINAPI -GdiGetClientObject( +GdiDeleteClientObj( _In_ HGDIOBJ hobj); +BOOL +WINAPI +GdiCreateClientObjLink( + _In_ HGDIOBJ hobj, + _In_ PVOID pvObject); + PVOID WINAPI -GdiRemoveClientObject( +GdiGetClientObjLink( _In_ HGDIOBJ hobj); +PVOID +WINAPI +GdiRemoveClientObjLink( + _In_ HGDIOBJ hobj); + +extern ULONG gcClientObj; + + /* EOF */ Modified: trunk/reactos/win32ss/gdi/gdi32/objects/clientobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/clientobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/clientobj.c [iso-8859-1] Mon Dec 29 13:11:48 2014 @@ -8,6 +8,7 @@ #include <precomp.h> CRITICAL_SECTION gcsClientObjLinks; +ULONG gcClientObj; typedef struct _CLIENTOBJLINK { @@ -18,37 +19,28 @@ PCLIENTOBJLINK gapcolHashTable[127]; -HGDIOBJ +BOOL WINAPI -GdiInsertClientObj( - _In_ PVOID pvObject, - _In_ GDILOOBJTYPE eObjType) +GdiCreateClientObjLink( + _In_ HGDIOBJ hobj, + _In_ PVOID pvObject) { PCLIENTOBJLINK pcol; ULONG iHashIndex; - HGDIOBJ hobj; - - /* Call win32k to create a client object handle */ - hobj = NtGdiCreateClientObj(eObjType); - if (hobj == NULL) - { - return NULL; - } - - /* Calculate the hash index */ - iHashIndex = (ULONG_PTR)hobj % _countof(gapcolHashTable); /* Allocate a link structure */ pcol = HeapAlloc(GetProcessHeap(), 0, sizeof(*pcol)); if (pcol == NULL) { - NtGdiDeleteClientObj(hobj); - return NULL; + return FALSE; } /* Setup the link structure */ pcol->hobj = hobj; pcol->pvObj = pvObject; + + /* Calculate the hash index */ + iHashIndex = (ULONG_PTR)hobj % _countof(gapcolHashTable); /* Enter the critical section */ EnterCriticalSection(&gcsClientObjLinks); @@ -56,16 +48,17 @@ /* Insert the link structure */ pcol->pcolNext = gapcolHashTable[iHashIndex]; gapcolHashTable[iHashIndex] = pcol; + gcClientObj++; /* Leave the critical section */ LeaveCriticalSection(&gcsClientObjLinks); - return hobj; + return TRUE; } PVOID WINAPI -GdiGetClientObject( +GdiGetClientObjLink( _In_ HGDIOBJ hobj) { ULONG iHashIndex; @@ -102,7 +95,7 @@ PVOID WINAPI -GdiRemoveClientObject( +GdiRemoveClientObjLink( _In_ HGDIOBJ hobj) { PCLIENTOBJLINK pcol, *ppcol; @@ -127,6 +120,7 @@ { /* Update the link pointer, removing this link */ *ppcol = pcol->pcolNext; + gcClientObj--; /* Get the object pointer */ pvObject = pcol->pvObj; @@ -148,3 +142,51 @@ /* Return the object pointer, or NULL if we did not find it */ return pvObject; } + +HGDIOBJ +WINAPI +GdiCreateClientObj( + _In_ PVOID pvObject, + _In_ GDILOOBJTYPE eObjType) +{ + HGDIOBJ hobj; + + /* Call win32k to create a client object handle */ + hobj = NtGdiCreateClientObj(eObjType); + if (hobj == NULL) + { + return NULL; + } + + /* Create the client object link */ + if (!GdiCreateClientObjLink(hobj, pvObject)) + { + NtGdiDeleteClientObj(hobj); + return NULL; + } + + return hobj; +} + +PVOID +WINAPI +GdiDeleteClientObj( + _In_ HGDIOBJ hobj) +{ + PVOID pvObject; + + /* Remove the client object link */ + pvObject = GdiRemoveClientObjLink(hobj); + if (pvObject == NULL) + { + return NULL; + } + + /* Call win32k to delete the handle */ + if (!NtGdiDeleteClientObj(hobj)) + { + ASSERT(FALSE); + } + + return pvObject; +}
9 years, 12 months
1
0
0
0
[tkreuzer] 65881: [GDI32] Improve GetROP2and SetROP2
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:11:40 2014 New Revision: 65881 URL:
http://svn.reactos.org/svn/reactos?rev=65881&view=rev
Log: [GDI32] Improve GetROP2and SetROP2 Modified: trunk/reactos/win32ss/gdi/gdi32/objects/dc.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/dc.c [iso-8859-1] Mon Dec 29 13:11:40 2014 @@ -1152,11 +1152,20 @@ */ int WINAPI -GetROP2(HDC hdc) -{ - PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; - return Dc_Attr->jROP2; +GetROP2( + _In_ HDC hdc) +{ + PDC_ATTR pdcattr; + + /* Get the DC attribute */ + pdcattr = GdiGetDcAttr(hdc); + if (pdcattr == NULL) + { + /* Do not set LastError here! */ + return 0; + } + + return pdcattr->jROP2; } /* @@ -1164,18 +1173,19 @@ */ int WINAPI -SetROP2(HDC hdc, - int fnDrawMode) -{ - PDC_ATTR Dc_Attr; - INT Old_ROP2; +SetROP2( + _In_ HDC hdc, + _In_ int rop2) +{ + PDC_ATTR pdcattr; + INT rop2Old; #if 0 // Handle something other than a normal dc object. if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) { if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) - return MFDRV_SetROP2( hdc, fnDrawMode); + return MFDRV_SetROP2( hdc, rop2); else { PLDC pLDC = GdiGetLDC(hdc); @@ -1186,27 +1196,34 @@ } if (pLDC->iType == LDC_EMFLDC) { - return EMFDRV_SetROP2(( hdc, fnDrawMode); + return EMFDRV_SetROP2(( hdc, rop2); } return FALSE; } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; + + /* Get the DC attribute */ + pdcattr = GdiGetDcAttr(hdc); + if (pdcattr == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { - if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY) + if (pdcattr->ulDirty_ & DC_MODE_DIRTY) { NtGdiFlush(); - Dc_Attr->ulDirty_ &= ~DC_MODE_DIRTY; - } - } - - Old_ROP2 = Dc_Attr->jROP2; - Dc_Attr->jROP2 = fnDrawMode; - - return Old_ROP2; + pdcattr->ulDirty_ &= ~DC_MODE_DIRTY; + } + } + + rop2Old = pdcattr->jROP2; + pdcattr->jROP2 = (BYTE)rop2; + + return rop2Old; }
9 years, 12 months
1
0
0
0
[tkreuzer] 65880: [GDI32] - Do not call BitBlt from StretchBlt when extension matches, this is handled in win32k - Use GdiGetDcAttr
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:11:35 2014 New Revision: 65880 URL:
http://svn.reactos.org/svn/reactos?rev=65880&view=rev
Log: [GDI32] - Do not call BitBlt from StretchBlt when extension matches, this is handled in win32k - Use GdiGetDcAttr Modified: trunk/reactos/win32ss/gdi/gdi32/objects/painting.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/painting.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/painting.c [iso-8859-1] Mon Dec 29 13:11:35 2014 @@ -66,7 +66,13 @@ } } #endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &pdcattr)) return FALSE; + /* Get the DC attribute */ + pdcattr = GdiGetDcAttr(hdc); + if (pdcattr == NULL) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } if (ppt) { @@ -852,33 +858,18 @@ _In_ INT cySrc, _In_ DWORD dwRop) { - if ((cxDest != cxSrc) || (cyDest != cySrc)) - { - return NtGdiStretchBlt(hdcDest, - xDest, - yDest, - cxDest, - cyDest, - hdcSrc, - xSrc, - ySrc, - cxSrc, - cySrc, - dwRop, - 0); - } - - return NtGdiBitBlt(hdcDest, - xDest, - yDest, - cxDest, - cyDest, - hdcSrc, - xSrc, - ySrc, - dwRop, - 0, - 0); + return NtGdiStretchBlt(hdcDest, + xDest, + yDest, + cxDest, + cyDest, + hdcSrc, + xSrc, + ySrc, + cxSrc, + cySrc, + dwRop, + 0); }
9 years, 12 months
1
0
0
0
[tkreuzer] 65879: [GDI32] Improve code in painting.c: - Add annotations - Use consitent formatting - Use better parameter/variable names
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:11:31 2014 New Revision: 65879 URL:
http://svn.reactos.org/svn/reactos?rev=65879&view=rev
Log: [GDI32] Improve code in painting.c: - Add annotations - Use consitent formatting - Use better parameter/variable names Modified: trunk/reactos/win32ss/gdi/gdi32/objects/painting.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/painting.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/painting.c [iso-8859-1] Mon Dec 29 13:11:31 2014 @@ -6,81 +6,88 @@ */ BOOL WINAPI -LineTo( HDC hDC, INT x, INT y ) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam2( hDC, META_LINETO, x, y); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return MFDRV_LineTo( hDC, x, y ) +LineTo( + _In_ HDC hdc, + _In_ INT x, + _In_ INT y ) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam2(hdc, META_LINETO, x, y); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if (!pLDC) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return MFDRV_LineTo(hdc, x, y ) } return FALSE; } } #endif - return NtGdiLineTo( hDC, x, y); -} - - -BOOL -WINAPI -MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point ) -{ - PDC_ATTR Dc_Attr; -#if 0 - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam2( hDC, META_MOVETO, x, y); - else - { - PLDC pLDC = Dc_Attr->pvLDC; - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - if (!EMFDRV_MoveTo( hDC, x, y)) return FALSE; - } - } - } -#endif - if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; - - if ( Point ) - { - if ( Dc_Attr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit! - { - Point->x = Dc_Attr->ptfxCurrent.x; // ret prev before change. - Point->y = Dc_Attr->ptfxCurrent.y; - DPtoLP ( hDC, Point, 1); // reconvert back. - } - else - { - Point->x = Dc_Attr->ptlCurrent.x; - Point->y = Dc_Attr->ptlCurrent.y; - } - } - - Dc_Attr->ptlCurrent.x = x; - Dc_Attr->ptlCurrent.y = y; - - Dc_Attr->ulDirty_ &= ~DIRTY_PTLCURRENT; - Dc_Attr->ulDirty_ |= ( DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); // Set dirty + return NtGdiLineTo(hdc, x, y); +} + + +BOOL +WINAPI +MoveToEx( + _In_ HDC hdc, + _In_ INT x, + _In_ INT y, + _Out_opt_ LPPOINT ppt) +{ + PDC_ATTR pdcattr; +#if 0 + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam2(hdc, META_MOVETO, x, y); + else + { + PLDC pLDC = pdcattr->pvLDC; + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + if (!EMFDRV_MoveTo(hdc, x, y)) return FALSE; + } + } + } +#endif + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &pdcattr)) return FALSE; + + if (ppt) + { + if ( pdcattr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit! + { + ppt->x = pdcattr->ptfxCurrent.x; // ret prev before change. + ppt->y = pdcattr->ptfxCurrent.y; + DPtoLP (hdc, ppt, 1); // reconvert back. + } + else + { + ppt->x = pdcattr->ptlCurrent.x; + ppt->y = pdcattr->ptlCurrent.y; + } + } + + pdcattr->ptlCurrent.x = x; + pdcattr->ptlCurrent.y = y; + + pdcattr->ulDirty_ &= ~DIRTY_PTLCURRENT; + pdcattr->ulDirty_ |= ( DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); // Set dirty return TRUE; } @@ -90,100 +97,116 @@ */ BOOL WINAPI -Ellipse(HDC hDC, INT Left, INT Top, INT Right, INT Bottom) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam4(hDC, META_ELLIPSE, Left, Top, Right, Bottom ); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_Ellipse( hDC, Left, Top, Right, Bottom ); - } - return FALSE; - } - } -#endif - return NtGdiEllipse( hDC, Left, Top, Right, Bottom); -} - - -/* - * @implemented - */ -BOOL -WINAPI -Rectangle(HDC hDC, INT Left, INT Top, INT Right, INT Bottom) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam4(hDC, META_RECTANGLE, Left, Top, Right, Bottom ); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_Rectangle( hDC, Left, Top, Right, Bottom ); - } - return FALSE; - } - } -#endif - return NtGdiRectangle( hDC, Left, Top, Right, Bottom); -} - - -/* - * @implemented - */ -BOOL -WINAPI -RoundRect(HDC hDC, INT Left, INT Top, INT Right, INT Bottom, - INT ell_Width, INT ell_Height) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam6( hDC, META_ROUNDRECT, Left, Top, Right, Bottom, - ell_Width, ell_Height ); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_RoundRect( hDC, Left, Top, Right, Bottom, - ell_Width, ell_Height ); - } - return FALSE; - } - } -#endif - return NtGdiRoundRect( hDC, Left, Top, Right, Bottom, ell_Width, ell_Height); +Ellipse( + _In_ HDC hdc, + _In_ INT left, + _In_ INT top, + _In_ INT right, + _In_ INT bottom) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam4(hdc, META_ELLIPSE, left, top, right, bottom ); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_Ellipse(hdc, left, top, right, bottom ); + } + return FALSE; + } + } +#endif + return NtGdiEllipse(hdc, left, top, right, bottom); +} + + +/* + * @implemented + */ +BOOL +WINAPI +Rectangle( + _In_ HDC hdc, + _In_ INT left, + _In_ INT top, + _In_ INT right, + _In_ INT bottom) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam4(hdc, META_RECTANGLE, left, top, right, bottom); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_Rectangle(hdc, left, top, right, bottom); + } + return FALSE; + } + } +#endif + return NtGdiRectangle(hdc, left, top, right, bottom); +} + + +/* + * @implemented + */ +BOOL +WINAPI +RoundRect( + _In_ HDC hdc, + _In_ INT left, + _In_ INT top, + _In_ INT right, + _In_ INT bottom, + _In_ INT width, + _In_ INT height) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam6(hdc, META_ROUNDRECT, left, top, right, bottom, + width, height ); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_RoundRect(hdc, left, top, right, bottom, + width, height ); + } + return FALSE; + } + } +#endif + return NtGdiRoundRect(hdc, left, top, right, bottom, width, height); } @@ -192,11 +215,14 @@ */ COLORREF WINAPI -GetPixel( HDC hDC, INT x, INT y ) -{ - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) return CLR_INVALID; - if (!GdiIsHandleValid((HGDIOBJ) hDC)) return CLR_INVALID; - return NtGdiGetPixel( hDC, x, y); +GetPixel( + _In_ HDC hdc, + _In_ INT x, + _In_ INT y) +{ + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) return CLR_INVALID; + if (!GdiIsHandleValid((HGDIOBJ) hdc)) return CLR_INVALID; + return NtGdiGetPixel(hdc, x, y); } @@ -205,18 +231,22 @@ */ COLORREF WINAPI -SetPixel( HDC hDC, INT x, INT y, COLORREF Color ) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_MetaParam4(hDC, META_SETPIXEL, x, y, HIWORD(Color), - LOWORD(Color)); - else - { - PLDC pLDC = GdiGetLDC(hDC); +SetPixel( + _In_ HDC hdc, + _In_ INT x, + _In_ INT y, + _In_ COLORREF crColor) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_MetaParam4(hdc, META_SETPIXEL, x, y, HIWORD(crColor), + LOWORD(crColor)); + else + { + PLDC pLDC = GdiGetLDC(hdc); if ( !pLDC ) { SetLastError(ERROR_INVALID_HANDLE); @@ -224,182 +254,202 @@ } if (pLDC->iType == LDC_EMFLDC) { - return EMFDRV_SetPixel( hDC, x, y, Color ); + return EMFDRV_SetPixel(hdc, x, y, crColor); } return 0; } } #endif - return NtGdiSetPixel( hDC, x, y, Color); -} - - -/* - * @implemented - */ -BOOL -WINAPI -SetPixelV( HDC hDC, INT x, INT y, COLORREF Color ) -{ - COLORREF Cr = SetPixel( hDC, x, y, Color ); - if (Cr != CLR_INVALID) return TRUE; - return FALSE; -} - - -/* - * @implemented - */ -BOOL -WINAPI -FillRgn( HDC hDC, HRGN hRgn, HBRUSH hBrush ) -{ - - if ( (!hRgn) || (!hBrush) ) return FALSE; -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_FillRgn( hDC, hRgn, hBrush); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_FillRgn(( hDC, hRgn, hBrush); + return NtGdiSetPixel(hdc, x, y, crColor); +} + + +/* + * @implemented + */ +BOOL +WINAPI +SetPixelV( + _In_ HDC hdc, + _In_ INT x, + _In_ INT y, + _In_ COLORREF crColor) +{ + return SetPixel(hdc, x, y, crColor) != CLR_INVALID; +} + + +/* + * @implemented + */ +BOOL +WINAPI +FillRgn( + _In_ HDC hdc, + _In_ HRGN hrgn, + _In_ HBRUSH hbr) +{ + + if ((hrgn == NULL) || (hbr == NULL)) + return FALSE; +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_FillRgn(hdc, hrgn, hbr); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_FillRgn((hdc, hrgn, hbr); } return FALSE; } } #endif - return NtGdiFillRgn( hDC, hRgn, hBrush); -} - - -/* - * @implemented - */ -BOOL -WINAPI -FrameRgn( HDC hDC, HRGN hRgn, HBRUSH hBrush, INT nWidth, INT nHeight ) -{ - - if ( (!hRgn) || (!hBrush) ) return FALSE; -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_FrameRgn( hDC, hRgn, hBrush, nWidth, nHeight ); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_FrameRgn( hDC, hRgn, hBrush, nWidth, nHeight ); - } - return FALSE; - } - } -#endif - return NtGdiFrameRgn( hDC, hRgn, hBrush, nWidth, nHeight); -} - - -/* - * @implemented - */ -BOOL -WINAPI -InvertRgn( HDC hDC, HRGN hRgn ) -{ - - if ( !hRgn ) return FALSE; -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_InvertRgn( hDC, HRGN hRgn ); // Use this instead of MFDRV_MetaParam. - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_PaintInvertRgn( hDC, hRgn, EMR_INVERTRGN ); - } - return FALSE; - } - } -#endif - return NtGdiInvertRgn( hDC, hRgn); -} - - -/* - * @implemented - */ -BOOL -WINAPI -PaintRgn( HDC hDC, HRGN hRgn ) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_PaintRgn( hDC, HRGN hRgn ); // Use this instead of MFDRV_MetaParam. - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_PaintInvertRgn( hDC, hRgn, EMR_PAINTRGN ); - } - return FALSE; - } - } -#endif -// Could just use Dc_Attr->hbrush? No. - HBRUSH hBrush = (HBRUSH)GetCurrentObject(hDC, OBJ_BRUSH); - - return NtGdiFillRgn( hDC, hRgn, hBrush); -} - - -/* - * @implemented - */ -BOOL -WINAPI -PolyBezier(HDC hDC ,const POINT* Point, DWORD cPoints) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) + return NtGdiFillRgn(hdc, hrgn, hbr); +} + + +/* + * @implemented + */ +BOOL +WINAPI +FrameRgn( + _In_ HDC hdc, + _In_ HRGN hrgn, + _In_ HBRUSH hbr, + _In_ INT nWidth, + _In_ INT nHeight) +{ + + if ((hrgn == NULL) || (hbr == NULL)) + return FALSE; +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_FrameRgn(hdc, hrgn, hbr, nWidth, nHeight ); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_FrameRgn(hdc, hrgn, hbr, nWidth, nHeight ); + } + return FALSE; + } + } +#endif + return NtGdiFrameRgn(hdc, hrgn, hbr, nWidth, nHeight); +} + + +/* + * @implemented + */ +BOOL +WINAPI +InvertRgn( + _In_ HDC hdc, + _In_ HRGN hrgn) +{ + + if (hrgn == NULL) + return FALSE; +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_InvertRgn(hdc, HRGN hrgn ); // Use this instead of MFDRV_MetaParam. + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_PaintInvertRgn(hdc, hrgn, EMR_INVERTRGN ); + } + return FALSE; + } + } +#endif + return NtGdiInvertRgn(hdc, hrgn); +} + + +/* + * @implemented + */ +BOOL +WINAPI +PaintRgn( + _In_ HDC hdc, + _In_ HRGN hrgn) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_PaintRgn(hdc, HRGN hrgn ); // Use this instead of MFDRV_MetaParam. + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_PaintInvertRgn(hdc, hrgn, EMR_PAINTRGN ); + } + return FALSE; + } + } +#endif +// Could just use pdcattr->hbrush? No. + HBRUSH hbr = GetCurrentObject(hdc, OBJ_BRUSH); + + return NtGdiFillRgn(hdc, hrgn, hbr); +} + + +/* + * @implemented + */ +BOOL +WINAPI +PolyBezier( + _In_ HDC hdc, + _In_reads_(cpt) const POINT *apt, + _In_ DWORD cpt) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) /* * Since MetaFiles don't record Beziers and they don't even record * approximations to them using lines. @@ -407,7 +457,7 @@ return FALSE; else { - PLDC pLDC = GdiGetLDC(hDC); + PLDC pLDC = GdiGetLDC(hdc); if ( !pLDC ) { SetLastError(ERROR_INVALID_HANDLE); @@ -421,26 +471,29 @@ } } #endif - return NtGdiPolyPolyDraw( hDC ,(PPOINT) Point, &cPoints, 1, GdiPolyBezier ); -} - - -/* - * @implemented - */ -BOOL -WINAPI -PolyBezierTo(HDC hDC, const POINT* Point ,DWORD cPoints) -{ -#if 0 -// Handle something other than a normal dc object. - 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); + return NtGdiPolyPolyDraw(hdc ,(PPOINT)apt, &cpt, 1, GdiPolyBezier); +} + + +/* + * @implemented + */ +BOOL +WINAPI +PolyBezierTo( + _In_ HDC hdc, + _In_reads_(cpt) const POINT *apt, + _In_ DWORD cpt) +{ +#if 0 +// Handle something other than a normal dc object. + 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); @@ -454,26 +507,30 @@ } } #endif - return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, &cPoints, 1, GdiPolyBezierTo ); -} - - -/* - * @implemented - */ -BOOL -WINAPI -PolyDraw(HDC hDC, const POINT* Point, const BYTE *lpbTypes, int cCount ) -{ -#if 0 -// Handle something other than a normal dc object. - 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); + return NtGdiPolyPolyDraw(hdc , (PPOINT)apt, &cpt, 1, GdiPolyBezierTo); +} + + +/* + * @implemented + */ +BOOL +WINAPI +PolyDraw( + _In_ HDC hdc, + _In_reads_(cpt) const POINT *apt, + _In_reads_(cpt) const BYTE *aj, + _In_ INT cpt) +{ +#if 0 +// Handle something other than a normal dc object. + 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); @@ -487,92 +544,101 @@ } } #endif - return NtGdiPolyDraw( hDC , (PPOINT) Point, (PBYTE)lpbTypes, cCount ); -} - - -/* - * @implemented - */ -BOOL -WINAPI -Polygon(HDC hDC, const POINT *Point, int Count) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_Polygon( hDC, Point, Count ); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_Polygon( hDC, Point, Count ); - } - return FALSE; - } - } -#endif - return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, (PULONG)&Count, 1, GdiPolyPolygon ); -} - - -/* - * @implemented - */ -BOOL -WINAPI -Polyline(HDC hDC, const POINT *Point, int Count) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_Polyline( hDC, Point, Count ); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_Polyline( hDC, Point, Count ); - } - return FALSE; - } - } -#endif - return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, (PULONG)&Count, 1, GdiPolyPolyLine ); -} - - -/* - * @implemented - */ -BOOL -WINAPI -PolylineTo(HDC hDC, const POINT* Point, DWORD Count) -{ -#if 0 -// Handle something other than a normal dc object. - 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); + return NtGdiPolyDraw(hdc, (PPOINT)apt, (PBYTE)aj, cpt); +} + + +/* + * @implemented + */ +BOOL +WINAPI +Polygon( + _In_ HDC hdc, + _In_reads_(cpt) const POINT *apt, + _In_ INT cpt) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_Polygon(hdc, apt, cpt ); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_Polygon(hdc, apt, cpt ); + } + return FALSE; + } + } +#endif + return NtGdiPolyPolyDraw(hdc , (PPOINT)apt, (PULONG)&cpt, 1, GdiPolyPolygon); +} + + +/* + * @implemented + */ +BOOL +WINAPI +Polyline( + _In_ HDC hdc, + _In_reads_(cpt) const POINT *apt, + _In_ INT cpt) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_Polyline(hdc, apt, cpt); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_Polyline(hdc, apt, cpt); + } + return FALSE; + } + } +#endif + return NtGdiPolyPolyDraw(hdc, (PPOINT)apt, (PULONG)&cpt, 1, GdiPolyPolyLine); +} + + +/* + * @implemented + */ +BOOL +WINAPI +PolylineTo( + _In_ HDC hdc, + _In_reads_(cpt) const POINT *apt, + _In_ DWORD cpt) +{ +#if 0 +// Handle something other than a normal dc object. + 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); @@ -586,73 +652,81 @@ } } #endif - return NtGdiPolyPolyDraw( hDC , (PPOINT) Point, &Count, 1, GdiPolyLineTo ); -} - - -/* - * @implemented - */ -BOOL -WINAPI -PolyPolygon(HDC hDC, const POINT* Point, const INT* Count, int Polys) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_PolyPolygon( hDC, Point, Count, Polys); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_PolyPolygon( hDC, Point, Count, Polys ); - } - return FALSE; - } - } -#endif - return NtGdiPolyPolyDraw( hDC , (PPOINT)Point, (PULONG)Count, Polys, GdiPolyPolygon ); -} - - -/* - * @implemented - */ -BOOL -WINAPI -PolyPolyline(HDC hDC, const POINT* Point, const DWORD* Counts, DWORD Polys) -{ -#if 0 -// Handle something other than a normal dc object. - 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->iType == LDC_EMFLDC) - { - return EMFDRV_PolyPolyline(hDC, Point, Counts, Polys); - } - return FALSE; - } - } -#endif - return NtGdiPolyPolyDraw( hDC , (PPOINT)Point, (PULONG)Counts, Polys, GdiPolyPolyLine ); + return NtGdiPolyPolyDraw(hdc , (PPOINT)apt, &cpt, 1, GdiPolyLineTo); +} + + +/* + * @implemented + */ +BOOL +WINAPI +PolyPolygon( + _In_ HDC hdc, + _In_ const POINT *apt, + _In_reads_(csz) const INT *asz, + _In_ INT csz) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_PolyPolygon(hdc, apt, asz, csz); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_PolyPolygon(hdc, apt, asz, csz ); + } + return FALSE; + } + } +#endif + return NtGdiPolyPolyDraw(hdc, (PPOINT)apt, (PULONG)asz, csz, GdiPolyPolygon); +} + + +/* + * @implemented + */ +BOOL +WINAPI +PolyPolyline( + _In_ HDC hdc, + _In_ CONST POINT *apt, + _In_reads_(csz) CONST DWORD *asz, + _In_ DWORD csz) +{ +#if 0 +// Handle something other than a normal dc object. + 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->iType == LDC_EMFLDC) + { + return EMFDRV_PolyPolyline(hdc, apt, asz, csz); + } + return FALSE; + } + } +#endif + return NtGdiPolyPolyDraw(hdc , (PPOINT)apt, (PULONG)asz, csz, GdiPolyPolyLine); } @@ -662,36 +736,35 @@ BOOL WINAPI ExtFloodFill( - HDC hDC, - int nXStart, - int nYStart, - COLORREF crFill, - UINT fuFillType -) -{ -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC) - return MFDRV_ExtFloodFill( hDC, nXStart, nYStart, crFill, fuFillType ); - else - { - PLDC pLDC = GdiGetLDC(hDC); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_ExtFloodFill( hDC, nXStart, nYStart, crFill, fuFillType ); - } - return FALSE; - } - } -#endif - return NtGdiExtFloodFill(hDC, nXStart, nYStart, crFill, fuFillType); + _In_ HDC hdc, + _In_ INT xStart, + _In_ INT yStart, + _In_ COLORREF crFill, + _In_ UINT fuFillType) +{ +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_ExtFloodFill(hdc, xStart, yStart, crFill, fuFillType ); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_ExtFloodFill(hdc, xStart, yStart, crFill, fuFillType ); + } + return FALSE; + } + } +#endif + return NtGdiExtFloodFill(hdc, xStart, yStart, crFill, fuFillType); } @@ -701,12 +774,12 @@ BOOL WINAPI FloodFill( - HDC hDC, - int nXStart, - int nYStart, - COLORREF crFill) -{ - return ExtFloodFill(hDC, nXStart, nYStart, crFill, FLOODFILLBORDER); + _In_ HDC hdc, + _In_ INT xStart, + _In_ INT yStart, + _In_ COLORREF crFill) +{ + return ExtFloodFill(hdc, xStart, yStart, crFill, FLOODFILLBORDER); } /* @@ -715,34 +788,34 @@ BOOL WINAPI BitBlt( - HDC hdcDest, /* handle to destination DC */ - int nXOriginDest, /* x-coord of destination upper-left corner */ - int nYOriginDest, /* y-coord of destination upper-left corner */ - int nWidthDest, /* width of destination rectangle */ - int nHeightDest, /* height of destination rectangle */ - HDC hdcSrc, /* handle to source DC */ - int nXSrc, /* x-coordinate of source upper-left corner */ - int nYSrc, /* y-coordinate of source upper-left corner */ - DWORD dwRop) /* raster operation code */ -{ - /* use patBlt for no source blt Like windows does */ + _In_ HDC hdcDest, + _In_ INT xDest, + _In_ INT yDest, + _In_ INT cx, + _In_ INT cy, + _In_opt_ HDC hdcSrc, + _In_ INT xSrc, + _In_ INT ySrc, + _In_ DWORD dwRop) +{ + /* Use PatBlt for no source blt, like windows does */ if (!ROP_USES_SOURCE(dwRop)) { - return PatBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, dwRop); - } - - return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXSrc, - nYSrc, dwRop, 0, 0); -} - -BOOL -WINAPI -PatBlt(HDC hdc, - int nXLeft, - int nYLeft, - int nWidth, - int nHeight, - DWORD dwRop) + return PatBlt(hdcDest, xDest, yDest, cx, cy, dwRop); + } + + return NtGdiBitBlt(hdcDest, xDest, yDest, cx, cy, hdcSrc, xSrc, ySrc, dwRop, 0, 0); +} + +BOOL +WINAPI +PatBlt( + _In_ HDC hdc, + _In_ INT nXLeft, + _In_ INT nYLeft, + _In_ INT nWidth, + _In_ INT nHeight, + _In_ DWORD dwRop) { /* FIXME some part need be done in user mode */ return NtGdiPatBlt( hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop); @@ -750,14 +823,15 @@ BOOL WINAPI -PolyPatBlt(IN HDC hdc, - IN DWORD rop4, - IN PPOLYPATBLT pPoly, - IN DWORD Count, - IN DWORD Mode) +PolyPatBlt( + _In_ HDC hdc, + _In_ DWORD dwRop, + _In_ PPOLYPATBLT pPoly, + _In_ DWORD nCount, + _In_ DWORD dwMode) { /* FIXME some part need be done in user mode */ - return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode); + return NtGdiPolyPatBlt(hdc, dwRop, pPoly, nCount, dwMode); } /* @@ -766,56 +840,75 @@ BOOL WINAPI StretchBlt( - HDC hdcDest, /* handle to destination DC */ - int nXOriginDest, /* x-coord of destination upper-left corner */ - int nYOriginDest, /* y-coord of destination upper-left corner */ - int nWidthDest, /* width of destination rectangle */ - int nHeightDest, /* height of destination rectangle */ - HDC hdcSrc, /* handle to source DC */ - int nXOriginSrc, /* x-coord of source upper-left corner */ - int nYOriginSrc, /* y-coord of source upper-left corner */ - int nWidthSrc, /* width of source rectangle */ - int nHeightSrc, /* height of source rectangle */ - DWORD dwRop) /* raster operation code */ - -{ - if ((nWidthDest != nWidthSrc) || (nHeightDest != nHeightSrc)) - { - return NtGdiStretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, - nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop, 0); - } - - return NtGdiBitBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, - nXOriginSrc, nYOriginSrc, dwRop, 0, 0); -} - - -/* - * @implemented - */ -BOOL WINAPI + _In_ HDC hdcDest, + _In_ INT xDest, + _In_ INT yDest, + _In_ INT cxDest, + _In_ INT cyDest, + _In_opt_ HDC hdcSrc, + _In_ INT xSrc, + _In_ INT ySrc, + _In_ INT cxSrc, + _In_ INT cySrc, + _In_ DWORD dwRop) +{ + if ((cxDest != cxSrc) || (cyDest != cySrc)) + { + return NtGdiStretchBlt(hdcDest, + xDest, + yDest, + cxDest, + cyDest, + hdcSrc, + xSrc, + ySrc, + cxSrc, + cySrc, + dwRop, + 0); + } + + return NtGdiBitBlt(hdcDest, + xDest, + yDest, + cxDest, + cyDest, + hdcSrc, + xSrc, + ySrc, + dwRop, + 0, + 0); +} + + +/* + * @implemented + */ +BOOL +WINAPI MaskBlt( - HDC hdcDest, - INT nXDest, - INT nYDest, - INT nWidth, - INT nHeight, - HDC hdcSrc, - INT nXSrc, - INT nYSrc, - HBITMAP hbmMask, - INT xMask, - INT yMask, - DWORD dwRop) + _In_ HDC hdcDest, + _In_ INT xDest, + _In_ INT yDest, + _In_ INT cx, + _In_ INT cy, + _In_ HDC hdcSrc, + _In_ INT xSrc, + _In_ INT ySrc, + _In_ HBITMAP hbmMask, + _In_ INT xMask, + _In_ INT yMask, + _In_ DWORD dwRop) { return NtGdiMaskBlt(hdcDest, - nXDest, - nYDest, - nWidth, - nHeight, + xDest, + yDest, + cx, + cy, hdcSrc, - nXSrc, - nYSrc, + xSrc, + ySrc, hbmMask, xMask, yMask, @@ -830,24 +923,24 @@ BOOL WINAPI PlgBlt( - HDC hdcDest, - const POINT *lpPoint, - HDC hdcSrc, - INT nXSrc, - INT nYSrc, - INT nWidth, - INT nHeight, - HBITMAP hbmMask, - INT xMask, - INT yMask) + _In_ HDC hdcDest, + _In_reads_(3) const POINT * ppt, + _In_ HDC hdcSrc, + _In_ INT xSrc, + _In_ INT ySrc, + _In_ INT cx, + _In_ INT cy, + _In_opt_ HBITMAP hbmMask, + _In_ INT xMask, + _In_ INT yMask) { return NtGdiPlgBlt(hdcDest, - (LPPOINT)lpPoint, + (LPPOINT)ppt, hdcSrc, - nXSrc, - nYSrc, - nWidth, - nHeight, + xSrc, + ySrc, + cx, + cy, hbmMask, xMask, yMask, @@ -857,58 +950,57 @@ BOOL WINAPI GdiAlphaBlend( - HDC hDCDst, - int DstX, - int DstY, - int DstCx, - int DstCy, - HDC hDCSrc, - int SrcX, - int SrcY, - int SrcCx, - int SrcCy, - BLENDFUNCTION BlendFunction) -{ - if ( hDCSrc == NULL ) return FALSE; - - if (GDI_HANDLE_GET_TYPE(hDCSrc) == GDI_OBJECT_TYPE_METADC) return FALSE; - - return NtGdiAlphaBlend( - hDCDst, - DstX, - DstY, - DstCx, - DstCy, - hDCSrc, - SrcX, - SrcY, - SrcCx, - SrcCy, - BlendFunction, - 0 ); -} - - -/* - * @implemented - */ -BOOL -WINAPI -GdiTransparentBlt(IN HDC hdcDst, - IN INT xDst, - IN INT yDst, - IN INT cxDst, - IN INT cyDst, - IN HDC hdcSrc, - IN INT xSrc, - IN INT ySrc, - IN INT cxSrc, - IN INT cySrc, - IN UINT TransColor - ) + _In_ HDC hdcDst, + _In_ INT xDst, + _In_ INT yDst, + _In_ INT cxDst, + _In_ INT cyDst, + _In_ HDC hdcSrc, + _In_ INT xSrc, + _In_ INT ySrc, + _In_ INT cxSrc, + _In_ INT cySrc, + _In_ BLENDFUNCTION blendfn) +{ + if (hdcSrc == NULL ) return FALSE; + + if (GDI_HANDLE_GET_TYPE(hdcSrc) == GDI_OBJECT_TYPE_METADC) return FALSE; + + return NtGdiAlphaBlend(hdcDst, + xDst, + yDst, + cxDst, + cyDst, + hdcSrc, + xSrc, + ySrc, + cxSrc, + cySrc, + blendfn, + 0); +} + + +/* + * @implemented + */ +BOOL +WINAPI +GdiTransparentBlt( + _In_ HDC hdcDst, + _In_ INT xDst, + _In_ INT yDst, + _In_ INT cxDst, + _In_ INT cyDst, + _In_ HDC hdcSrc, + _In_ INT xSrc, + _In_ INT ySrc, + _In_ INT cxSrc, + _In_ INT cySrc, + _In_ UINT crTransparent) { /* FIXME some part need be done in user mode */ - return NtGdiTransparentBlt(hdcDst, xDst, yDst, cxDst, cyDst, hdcSrc, xSrc, ySrc, cxSrc, cySrc, (COLORREF)TransColor); + return NtGdiTransparentBlt(hdcDst, xDst, yDst, cxDst, cyDst, hdcSrc, xSrc, ySrc, cxSrc, cySrc, crTransparent); } /* @@ -917,13 +1009,13 @@ BOOL WINAPI GdiGradientFill( - IN HDC hdc, - IN PTRIVERTEX pVertex, - IN ULONG nVertex, - IN PVOID pMesh, - IN ULONG nMesh, - IN ULONG ulMode) + _In_ HDC hdc, + _In_reads_(nVertex) PTRIVERTEX pVertex, + _In_ ULONG nVertex, + _In_ PVOID pMesh, + _In_ ULONG nCount, + _In_ ULONG ulMode) { /* FIXME some part need be done in user mode */ - return NtGdiGradientFill(hdc, pVertex, nVertex, pMesh, nMesh, ulMode); -} + return NtGdiGradientFill(hdc, pVertex, nVertex, pMesh, nCount, ulMode); +}
9 years, 12 months
1
0
0
0
[tkreuzer] 65878: [GDI32] Move PatBlt, GetROP2 and SetROP2 to appropriate source files
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:11:27 2014 New Revision: 65878 URL:
http://svn.reactos.org/svn/reactos?rev=65878&view=rev
Log: [GDI32] Move PatBlt, GetROP2 and SetROP2 to appropriate source files Modified: trunk/reactos/win32ss/gdi/gdi32/objects/brush.c trunk/reactos/win32ss/gdi/gdi32/objects/dc.c trunk/reactos/win32ss/gdi/gdi32/objects/painting.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/brush.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/brush.c [iso-8859-1] Mon Dec 29 13:11:27 2014 @@ -258,94 +258,6 @@ return hBrush; } -BOOL -WINAPI -PatBlt(HDC hdc, - int nXLeft, - int nYLeft, - int nWidth, - int nHeight, - DWORD dwRop) -{ - /* FIXME some part need be done in user mode */ - return NtGdiPatBlt( hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop); -} - -BOOL -WINAPI -PolyPatBlt(IN HDC hdc, - IN DWORD rop4, - IN PPOLYPATBLT pPoly, - IN DWORD Count, - IN DWORD Mode) -{ - /* FIXME some part need be done in user mode */ - return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode); -} - -/* - * @implemented - * - */ -int -WINAPI -GetROP2(HDC hdc) -{ - PDC_ATTR Dc_Attr; - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; - return Dc_Attr->jROP2; -} - -/* - * @implemented - */ -int -WINAPI -SetROP2(HDC hdc, - int fnDrawMode) -{ - PDC_ATTR Dc_Attr; - INT Old_ROP2; - -#if 0 -// Handle something other than a normal dc object. - if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) - return MFDRV_SetROP2( hdc, fnDrawMode); - else - { - PLDC pLDC = GdiGetLDC(hdc); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_SetROP2(( hdc, fnDrawMode); - } - return FALSE; - } - } -#endif - if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; - - if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) - { - if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY) - { - NtGdiFlush(); - Dc_Attr->ulDirty_ &= ~DC_MODE_DIRTY; - } - } - - Old_ROP2 = Dc_Attr->jROP2; - Dc_Attr->jROP2 = fnDrawMode; - - return Old_ROP2; -} - /* * @implemented * Modified: trunk/reactos/win32ss/gdi/gdi32/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/dc.c [iso-8859-1] Mon Dec 29 13:11:27 2014 @@ -1145,6 +1145,70 @@ return iOldMode; } + +/* + * @implemented + * + */ +int +WINAPI +GetROP2(HDC hdc) +{ + PDC_ATTR Dc_Attr; + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; + return Dc_Attr->jROP2; +} + +/* + * @implemented + */ +int +WINAPI +SetROP2(HDC hdc, + int fnDrawMode) +{ + PDC_ATTR Dc_Attr; + INT Old_ROP2; + +#if 0 +// Handle something other than a normal dc object. + if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) + { + if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) + return MFDRV_SetROP2( hdc, fnDrawMode); + else + { + PLDC pLDC = GdiGetLDC(hdc); + if ( !pLDC ) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (pLDC->iType == LDC_EMFLDC) + { + return EMFDRV_SetROP2(( hdc, fnDrawMode); + } + return FALSE; + } + } +#endif + if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; + + if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) + { + if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY) + { + NtGdiFlush(); + Dc_Attr->ulDirty_ &= ~DC_MODE_DIRTY; + } + } + + Old_ROP2 = Dc_Attr->jROP2; + Dc_Attr->jROP2 = fnDrawMode; + + return Old_ROP2; +} + /* * @implemented Modified: trunk/reactos/win32ss/gdi/gdi32/objects/painting.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/painting.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/painting.c [iso-8859-1] Mon Dec 29 13:11:27 2014 @@ -735,6 +735,30 @@ nYSrc, dwRop, 0, 0); } +BOOL +WINAPI +PatBlt(HDC hdc, + int nXLeft, + int nYLeft, + int nWidth, + int nHeight, + DWORD dwRop) +{ + /* FIXME some part need be done in user mode */ + return NtGdiPatBlt( hdc, nXLeft, nYLeft, nWidth, nHeight, dwRop); +} + +BOOL +WINAPI +PolyPatBlt(IN HDC hdc, + IN DWORD rop4, + IN PPOLYPATBLT pPoly, + IN DWORD Count, + IN DWORD Mode) +{ + /* FIXME some part need be done in user mode */ + return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode); +} /* * @implemented
9 years, 12 months
1
0
0
0
[tkreuzer] 65877: [GDI32] Add anotations to arc.c, replace an instance of the ugly gfx_worker with an RCAST() macro
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Dec 29 13:11:07 2014 New Revision: 65877 URL:
http://svn.reactos.org/svn/reactos?rev=65877&view=rev
Log: [GDI32] Add anotations to arc.c, replace an instance of the ugly gfx_worker with an RCAST() macro Modified: trunk/reactos/win32ss/gdi/gdi32/include/gdi32p.h trunk/reactos/win32ss/gdi/gdi32/objects/arc.c Modified: trunk/reactos/win32ss/gdi/gdi32/include/gdi32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/include/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/include/gdi32p.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/include/gdi32p.h [iso-8859-1] Mon Dec 29 13:11:07 2014 @@ -39,6 +39,8 @@ /* MACRO ********************************************************************/ #define ROP_USES_SOURCE(Rop) (((Rop) << 2 ^ Rop) & 0xCC0000) +#define RCAST(_Type, _Value) (*((_Type*)&_Value)) + /* TYPES *********************************************************************/ Modified: trunk/reactos/win32ss/gdi/gdi32/objects/arc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/arc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/arc.c [iso-8859-1] Mon Dec 29 13:11:07 2014 @@ -3,16 +3,15 @@ BOOL WINAPI Arc( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXStartArc, - int nYStartArc, - int nXEndArc, - int nYEndArc -) + _In_ HDC hdc, + _In_ INT xLeft, + _In_ INT yTop, + _In_ INT xRight, + _In_ INT yBottom, + _In_ INT xStartArc, + _In_ INT yStartArc, + _In_ INT xEndArc, + _In_ INT yEndArc) { #if 0 // Handle something other than a normal dc object. @@ -40,15 +39,15 @@ } #endif return NtGdiArcInternal(GdiTypeArc, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXStartArc, - nYStartArc, - nXEndArc, - nYEndArc); + hdc, + xLeft, + yTop, + xRight, + yBottom, + xStartArc, + yStartArc, + xEndArc, + yEndArc); } @@ -57,18 +56,14 @@ */ BOOL WINAPI -AngleArc(HDC hDC, - int X, - int Y, - DWORD Radius, - FLOAT StartAngle, - FLOAT SweepAngle) -{ - gxf_long worker, worker1; - - worker.f = StartAngle; - worker1.f = SweepAngle; - +AngleArc( + _In_ HDC hdc, + _In_ INT x, + _In_ INT y, + _In_ DWORD dwRadius, + _In_ FLOAT eStartAngle, + _In_ FLOAT eSweepAngle) +{ #if 0 // Handle something other than a normal dc object. if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC) @@ -92,21 +87,26 @@ } } #endif - return NtGdiAngleArc(hDC, X, Y, Radius, (DWORD)worker.l, (DWORD)worker1.l); + return NtGdiAngleArc(hdc, + x, + y, + dwRadius, + RCAST(DWORD, eStartAngle), + RCAST(DWORD, eSweepAngle)); } BOOL WINAPI ArcTo( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXRadial1, - int nYRadial1, - int nXRadial2, - int nYRadial2) + _In_ HDC hdc, + _In_ INT xLeft, + _In_ INT yTop, + _In_ INT xRight, + _In_ INT yBottom, + _In_ INT xRadial1, + _In_ INT yRadial1, + _In_ INT xRadial2, + _In_ INT yRadial2) { #if 0 // Handle something other than a normal dc object. @@ -132,29 +132,29 @@ } #endif return NtGdiArcInternal(GdiTypeArcTo, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXRadial1, - nYRadial1, - nXRadial2, - nYRadial2); + hdc, + xLeft, + yTop, + xRight, + yBottom, + xRadial1, + yRadial1, + xRadial2, + yRadial2); } BOOL WINAPI Chord( - HDC hDC, - int nLeftRect, - int nTopRect, - int nRightRect, - int nBottomRect, - int nXRadial1, - int nYRadial1, - int nXRadial2, - int nYRadial2) + _In_ HDC hdc, + _In_ INT xLeft, + _In_ INT yTop, + _In_ INT xRight, + _In_ INT yBottom, + _In_ INT xRadial1, + _In_ INT yRadial1, + _In_ INT xRadial2, + _In_ INT yRadial2) { #if 0 // Handle something other than a normal dc object. @@ -180,15 +180,15 @@ } #endif return NtGdiArcInternal(GdiTypeChord, - hDC, - nLeftRect, - nTopRect, - nRightRect, - nBottomRect, - nXRadial1, - nYRadial1, - nXRadial2, - nYRadial2); + hdc, + xLeft, + yTop, + xRight, + yBottom, + xRadial1, + yRadial1, + xRadial2, + yRadial2); } @@ -198,16 +198,15 @@ BOOL WINAPI Pie( - HDC hDC, - int a1, - int a2, - int a3, - int a4, - int a5, - int a6, - int a7, - int a8 -) + _In_ HDC hdc, + _In_ INT xLeft, + _In_ INT yTop, + _In_ INT xRight, + _In_ INT yBottom, + _In_ INT xRadial1, + _In_ INT yRadial1, + _In_ INT xRadial2, + _In_ INT yRadial2) { #if 0 // Handle something other than a normal dc object. @@ -232,7 +231,16 @@ } } #endif - return NtGdiArcInternal(GdiTypePie, hDC, a1, a2, a3, a4, a5, a6, a7, a8); -} - - + return NtGdiArcInternal(GdiTypePie, + hdc, + xLeft, + yTop, + xRight, + yBottom, + xRadial1, + yRadial1, + xRadial2, + yRadial2); +} + +
9 years, 12 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
39
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Results per page:
10
25
50
100
200