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
February 2015
----- 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
16 participants
372 discussions
Start a n
N
ew thread
[tkreuzer] 66227: [WIN32K] Improve naming of some BRUSH fields and set the correct fields to the correct values (ulStyle was not for the brush style, but the hatch style!)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 11 21:33:50 2015 New Revision: 66227 URL:
http://svn.reactos.org/svn/reactos?rev=66227&view=rev
Log: [WIN32K] Improve naming of some BRUSH fields and set the correct fields to the correct values (ulStyle was not for the brush style, but the hatch style!) Modified: trunk/reactos/win32ss/gdi/eng/engbrush.c trunk/reactos/win32ss/gdi/ntgdi/arc.c trunk/reactos/win32ss/gdi/ntgdi/brush.c trunk/reactos/win32ss/gdi/ntgdi/brush.h trunk/reactos/win32ss/gdi/ntgdi/drawing.c trunk/reactos/win32ss/gdi/ntgdi/fillshap.c trunk/reactos/win32ss/gdi/ntgdi/pen.c trunk/reactos/win32ss/gdi/ntgdi/stockobj.c Modified: trunk/reactos/win32ss/gdi/eng/engbrush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engbrush.c…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/engbrush.c [iso-8859-1] Wed Feb 11 21:33:50 2015 @@ -312,8 +312,8 @@ if (pbr->flAttrs & BR_IS_HATCH) { /* Get the hatch brush pattern from the PDEV */ - hbmPattern = (HBITMAP)ppdev->ahsurf[pbr->ulStyle]; - iHatch = pbr->ulStyle; + hbmPattern = (HBITMAP)ppdev->ahsurf[pbr->iHatch]; + iHatch = pbr->iHatch; } else { Modified: trunk/reactos/win32ss/gdi/ntgdi/arc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/arc.c?re…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] Wed Feb 11 21:33:50 2015 @@ -79,7 +79,7 @@ return FALSE; } - PenOrigWidth = PenWidth = pbrPen->ptPenWidth.x; + PenOrigWidth = PenWidth = pbrPen->lWidth; if (pbrPen->ulPenStyle == PS_NULL) PenWidth = 0; if (pbrPen->ulPenStyle == PS_INSIDEFRAME) @@ -93,7 +93,7 @@ } if (!PenWidth) PenWidth = 1; - pbrPen->ptPenWidth.x = PenWidth; + pbrPen->lWidth = PenWidth; RectBounds.left = Left; RectBounds.right = Right; @@ -181,7 +181,7 @@ if (arctype == GdiTypeChord) PUTLINE(EfCx + CenterX, EfCy + CenterY, SfCx + CenterX, SfCy + CenterY, dc->eboLine); - pbrPen->ptPenWidth.x = PenOrigWidth; + pbrPen->lWidth = PenOrigWidth; PEN_ShareUnlockPen(pbrPen); DPRINT("IntArc Exit.\n"); return ret; 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] Wed Feb 11 21:33:50 2015 @@ -181,7 +181,7 @@ else if (pbrush->flAttrs & BR_IS_HATCH) { plogbrush->lbStyle = BS_HATCHED; - plogbrush->lbHatch = pbrush->ulStyle; + plogbrush->lbHatch = pbrush->iHatch; } else if (pbrush->flAttrs & BR_IS_DIB) { @@ -293,7 +293,7 @@ pbrush->flAttrs |= BR_IS_HATCH; pbrush->BrushAttr.lbColor = Color & 0xFFFFFF; - pbrush->ulStyle = Style; + pbrush->iHatch = Style; GDIOBJ_vUnlockObject(&pbrush->BaseObject); Modified: trunk/reactos/win32ss/gdi/ntgdi/brush.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/brush.h?…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/brush.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/brush.h [iso-8859-1] Wed Feb 11 21:33:50 2015 @@ -13,31 +13,40 @@ */ typedef struct _BRUSH { - /* Header for all gdi objects in the handle table. - Do not (re)move this. */ - BASEOBJECT BaseObject; + /* Header for all gdi objects in the handle table. + Do not (re)move this. */ + BASEOBJECT BaseObject; - ULONG ulStyle; - HBITMAP hbmPattern; - HBITMAP hbmClient; - ULONG flAttrs; + ULONG iHatch; // This is not the brush style, but the hatch style! + HBITMAP hbmPattern; + HBITMAP hbmClient; + ULONG flAttrs; - ULONG ulBrushUnique; - BRUSH_ATTR *pBrushAttr; // Just like DC_ATTR, pointer to user data - BRUSH_ATTR BrushAttr; // " " DCOBJ, internal if pBrushAttr == Zero - POINT ptOrigin; - ULONG bCacheGrabbed; - COLORREF crBack; - COLORREF crFore; - ULONG ulPalTime; - ULONG ulSurfTime; - PVOID ulRealization; - //ULONG Unknown4C[3]; - POINT ptPenWidth; - ULONG ulPenStyle; - DWORD *pStyle; - ULONG dwStyleCount; - //ULONG Unknown6C; + ULONG ulBrushUnique; + BRUSH_ATTR *pBrushAttr; // Pointer to the currently active brush attribute + BRUSH_ATTR BrushAttr; // Internal brush attribute for global brushes + POINT ptOrigin; + ULONG bCacheGrabbed; + COLORREF crBack; + COLORREF crFore; + ULONG ulPalTime; + ULONG ulSurfTime; + PVOID pvRBrush; + HDEV hdev; + //DWORD unk054; + LONG lWidth; + FLOAT eWidth; + ULONG ulPenStyle; + DWORD *pStyle; + ULONG dwStyleCount; + BYTE jJoin; // 0x06c Join styles for geometric wide lines + BYTE jEndCap; // end cap style for a geometric wide line + //WORD unk06e; // 0x06e + INT iBrushStyle; // 0x070 + //PREGION prgn; // 0x074 + //DWORD unk078; // 0x078 + DWORD unk07c; // 0x07c + LIST_ENTRY ListHead; // 0x080 } BRUSH, *PBRUSH; typedef struct _EBRUSHOBJ @@ -91,8 +100,17 @@ #define BRUSH_ShareLockBrush(hBrush) ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)) #define BRUSH_ShareUnlockBrush(pBrush) GDIOBJ_vDereferenceObject((POBJ)pBrush) -INT FASTCALL BRUSH_GetObject (PBRUSH GdiObject, INT Count, LPLOGBRUSH Buffer); -VOID NTAPI BRUSH_vCleanup(PVOID ObjectBody); +INT +FASTCALL +BRUSH_GetObject( + PBRUSH GdiObject, + INT Count, + LPLOGBRUSH Buffer); + +VOID +NTAPI +BRUSH_vCleanup( + PVOID ObjectBody); extern HSURF gahsurfHatch[HS_DDI_MAX]; Modified: trunk/reactos/win32ss/gdi/ntgdi/drawing.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/drawing.…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/drawing.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/drawing.c [iso-8859-1] Wed Feb 11 21:33:50 2015 @@ -139,7 +139,7 @@ int d2xt = b2+b2; int d2yt = a2+a2; - int w = pbrush->ptPenWidth.x; + int w = pbrush->lWidth; /* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */ @@ -983,7 +983,7 @@ int d2xt = b2+b2; int d2yt = a2+a2; - int w = pbrushPen->ptPenWidth.x; + int w = pbrushPen->lWidth; /* Inner ellipse: E(X,Y) = B*B*X*X + A*A*Y*Y - A*A*B*B */ @@ -1470,7 +1470,7 @@ { Rect r; int rx, ry; /* Radius in x and y directions */ - int w = pbrushPen->ptPenWidth.x; + int w = pbrushPen->lWidth; r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top)); rx = Wellipse/2; Modified: trunk/reactos/win32ss/gdi/ntgdi/fillshap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/fillshap…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] Wed Feb 11 21:33:50 2015 @@ -252,7 +252,7 @@ return FALSE; } - PenOrigWidth = PenWidth = pbrush->ptPenWidth.x; + PenOrigWidth = PenWidth = pbrush->lWidth; if (pbrush->ulPenStyle == PS_NULL) PenWidth = 0; if (pbrush->ulPenStyle == PS_INSIDEFRAME) @@ -266,7 +266,7 @@ } if (!PenWidth) PenWidth = 1; - pbrush->ptPenWidth.x = PenWidth; + pbrush->lWidth = PenWidth; RectBounds.left = Left; RectBounds.right = Right; @@ -330,7 +330,7 @@ DC_vFinishBlit(dc, NULL); } - pbrush->ptPenWidth.x = PenOrigWidth; + pbrush->lWidth = PenOrigWidth; PEN_ShareUnlockPen(pbrush); DC_UnlockDc(dc); DPRINT("Ellipse Exit.\n"); @@ -760,7 +760,7 @@ return FALSE; } - PenOrigWidth = PenWidth = pbrLine->ptPenWidth.x; + PenOrigWidth = PenWidth = pbrLine->lWidth; if (pbrLine->ulPenStyle == PS_NULL) PenWidth = 0; if (pbrLine->ulPenStyle == PS_INSIDEFRAME) @@ -774,7 +774,7 @@ } if (!PenWidth) PenWidth = 1; - pbrLine->ptPenWidth.x = PenWidth; + pbrLine->lWidth = PenWidth; RectBounds.left = Left; RectBounds.top = Top; @@ -829,7 +829,7 @@ } - pbrLine->ptPenWidth.x = PenOrigWidth; + pbrLine->lWidth = PenOrigWidth; PEN_ShareUnlockPen(pbrLine); return ret; } Modified: trunk/reactos/win32ss/gdi/ntgdi/pen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/pen.c?re…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/pen.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/pen.c [iso-8859-1] Wed Feb 11 21:33:50 2015 @@ -120,11 +120,11 @@ if ((bOldStylePen) && (!dwWidth) && ((dwPenStyle & PS_STYLE_MASK) != PS_SOLID)) dwWidth = 1; - pbrushPen->ptPenWidth.x = dwWidth; - pbrushPen->ptPenWidth.y = 0; + pbrushPen->lWidth = dwWidth; + pbrushPen->eWidth = (FLOAT)pbrushPen->lWidth; pbrushPen->ulPenStyle = dwPenStyle; pbrushPen->BrushAttr.lbColor = ulColor; - pbrushPen->ulStyle = ulBrushStyle; + pbrushPen->iBrushStyle = ulBrushStyle; // FIXME: Copy the bitmap first ? pbrushPen->hbmClient = (HANDLE)ulClientHatch; pbrushPen->dwStyleCount = dwStyleCount; @@ -256,7 +256,7 @@ pExtLogPen = (PEXTLOGPEN)pBuffer; pExtLogPen->elpPenStyle = pbrushPen->ulPenStyle; pExtLogPen->elpWidth = 0; - pExtLogPen->elpBrushStyle = pbrushPen->ulStyle; + pExtLogPen->elpBrushStyle = pbrushPen->iBrushStyle; pExtLogPen->elpColor = pbrushPen->BrushAttr.lbColor; pExtLogPen->elpHatch = 0; pExtLogPen->elpNumEntries = 0; @@ -265,7 +265,8 @@ else { pLogPen = (PLOGPEN)pBuffer; - pLogPen->lopnWidth = pbrushPen->ptPenWidth; + pLogPen->lopnWidth.x = pbrushPen->lWidth; + pLogPen->lopnWidth.y = 0; pLogPen->lopnStyle = pbrushPen->ulPenStyle; pLogPen->lopnColor = pbrushPen->BrushAttr.lbColor; } @@ -282,8 +283,8 @@ if (cbCount < cbRetCount) return 0; pExtLogPen = (PEXTLOGPEN)pBuffer; pExtLogPen->elpPenStyle = pbrushPen->ulPenStyle; - pExtLogPen->elpWidth = pbrushPen->ptPenWidth.x; - pExtLogPen->elpBrushStyle = pbrushPen->ulStyle; + pExtLogPen->elpWidth = pbrushPen->lWidth; + pExtLogPen->elpBrushStyle = pbrushPen->iBrushStyle; pExtLogPen->elpColor = pbrushPen->BrushAttr.lbColor; pExtLogPen->elpHatch = (ULONG_PTR)pbrushPen->hbmClient; pExtLogPen->elpNumEntries = pbrushPen->dwStyleCount; Modified: trunk/reactos/win32ss/gdi/ntgdi/stockobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/stockobj…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/stockobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/stockobj.c [iso-8859-1] Wed Feb 11 21:33:50 2015 @@ -114,11 +114,12 @@ if ((dwPenStyle & PS_STYLE_MASK) == PS_NULL) dwWidth = 1; - pbrushPen->ptPenWidth.x = abs(dwWidth); - pbrushPen->ptPenWidth.y = 0; + pbrushPen->iHatch = 0; + pbrushPen->lWidth = abs(dwWidth); + pbrushPen->eWidth = (FLOAT)pbrushPen->lWidth; pbrushPen->ulPenStyle = dwPenStyle; pbrushPen->BrushAttr.lbColor = ulColor; - pbrushPen->ulStyle = ulBrushStyle; + pbrushPen->iBrushStyle = ulBrushStyle; pbrushPen->hbmClient = (HANDLE)NULL; pbrushPen->dwStyleCount = 0; pbrushPen->pStyle = 0;
9 years, 10 months
1
0
0
0
[tkreuzer] 66226: [WIN32K] - Make sure PENs and BRUSHes are properly initialized. - Fix BRUSHATTR allocation - enable BRUSHATTR deallocation - Remove some obsolete defines
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 11 21:33:24 2015 New Revision: 66226 URL:
http://svn.reactos.org/svn/reactos?rev=66226&view=rev
Log: [WIN32K] - Make sure PENs and BRUSHes are properly initialized. - Fix BRUSHATTR allocation - enable BRUSHATTR deallocation - Remove some obsolete defines Modified: trunk/reactos/win32ss/gdi/ntgdi/brush.c trunk/reactos/win32ss/gdi/ntgdi/brush.h trunk/reactos/win32ss/gdi/ntgdi/color.h trunk/reactos/win32ss/gdi/ntgdi/pen.c trunk/reactos/win32ss/gdi/ntgdi/pen.h 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] Wed Feb 11 21:33:24 2015 @@ -11,19 +11,80 @@ #define NDEBUG #include <debug.h> -#define GDIOBJATTRFREE 170 - -typedef struct _GDI_OBJ_ATTR_FREELIST -{ - LIST_ENTRY Entry; - DWORD nEntries; - PVOID AttrList[GDIOBJATTRFREE]; -} GDI_OBJ_ATTR_FREELIST, *PGDI_OBJ_ATTR_FREELIST; - -typedef struct _GDI_OBJ_ATTR_ENTRY -{ - RGN_ATTR Attr[GDIOBJATTRFREE]; -} GDI_OBJ_ATTR_ENTRY, *PGDI_OBJ_ATTR_ENTRY; +static +VOID +BRUSH_vInit( + PBRUSH pbr) +{ + /* Start with kmode brush attribute */ + pbr->pBrushAttr = &pbr->BrushAttr; +} + +static +PBRUSH +BRUSH_AllocBrushWithHandle( + VOID) +{ + PBRUSH pbr; + + pbr = (PBRUSH)GDIOBJ_AllocObjWithHandle(GDILoObjType_LO_BRUSH_TYPE, sizeof(BRUSH)); + if (pbr == NULL) + { + return NULL; + } + + BRUSH_vInit(pbr); + return pbr; +} + +static +BOOL +BRUSH_bAllocBrushAttr(PBRUSH pbr) +{ + PPROCESSINFO ppi; + BRUSH_ATTR *pBrushAttr; + NT_ASSERT(pbr->pBrushAttr == &pbr->BrushAttr); + + ppi = PsGetCurrentProcessWin32Process(); + NT_ASSERT(ppi); + + pBrushAttr = GdiPoolAllocate(ppi->pPoolBrushAttr); + if (!pBrushAttr) + { + DPRINT1("Could not allocate brush attr\n"); + return FALSE; + } + + /* Copy the content from the kernel mode dc attr */ + pbr->pBrushAttr = pBrushAttr; + *pbr->pBrushAttr = pbr->BrushAttr; + + /* Set the object attribute in the handle table */ + GDIOBJ_vSetObjectAttr(&pbr->BaseObject, pBrushAttr); + + DPRINT("BRUSH_bAllocBrushAttr: pbr=%p, pbr->pdcattr=%p\n", pbr, pbr->pBrushAttr); + return TRUE; +} + +static +VOID +BRUSH_vFreeBrushAttr(PBRUSH pbr) +{ + PPROCESSINFO ppi; + + if (pbr->pBrushAttr == &pbr->BrushAttr) return; + + /* Reset the object attribute in the handle table */ + GDIOBJ_vSetObjectAttr(&pbr->BaseObject, NULL); + + /* Free memory from the process gdi pool */ + ppi = PsGetCurrentProcessWin32Process(); + ASSERT(ppi); + GdiPoolFree(ppi->pPoolBrushAttr, pbr->pBrushAttr); + + /* Reset to kmode brush attribute */ + pbr->pBrushAttr = &pbr->BrushAttr; +} BOOL FASTCALL @@ -34,16 +95,20 @@ if ((ulOwner == GDI_OBJ_HMGR_PUBLIC) || ulOwner == GDI_OBJ_HMGR_NONE) { + /* Free user mode attribute, if any */ + BRUSH_vFreeBrushAttr(pbr); + // Deny user access to User Data. GDIOBJ_vSetObjectAttr(&pbr->BaseObject, NULL); - // FIXME: deallocate brush attr } if (ulOwner == GDI_OBJ_HMGR_POWNED) { + /* Allocate a user mode attribute */ + BRUSH_bAllocBrushAttr(pbr); + // Allow user access to User Data. GDIOBJ_vSetObjectAttr(&pbr->BaseObject, pbr->pBrushAttr); - // FIXME: Allocate brush attr } GDIOBJ_vSetObjectOwner(&pbr->BaseObject, ulOwner); @@ -62,56 +127,6 @@ Ret = IntGdiSetBrushOwner(pbrush, ulOwner); BRUSH_ShareUnlockBrush(pbrush); return Ret; -} - -BOOL -NTAPI -BRUSH_bAllocBrushAttr(PBRUSH pbr) -{ - PPROCESSINFO ppi; - BRUSH_ATTR *pBrushAttr; - - ppi = PsGetCurrentProcessWin32Process(); - ASSERT(ppi); - - pBrushAttr = GdiPoolAllocate(ppi->pPoolDcAttr); - if (!pBrushAttr) - { - DPRINT1("Could not allocate brush attr\n"); - return FALSE; - } - - /* Copy the content from the kernel mode dc attr */ - pbr->pBrushAttr = pBrushAttr; - *pbr->pBrushAttr = pbr->BrushAttr; - - /* Set the object attribute in the handle table */ - GDIOBJ_vSetObjectAttr(&pbr->BaseObject, pBrushAttr); - - DPRINT("BRUSH_bAllocBrushAttr: pbr=%p, pbr->pdcattr=%p\n", pbr, pbr->pBrushAttr); - return TRUE; -} - - -VOID -NTAPI -BRUSH_vFreeBrushAttr(PBRUSH pbr) -{ -#if 0 - PPROCESSINFO ppi; - - if (pbrush->pBrushAttr == &pbrush->BrushAttr) return; - - /* Reset the object attribute in the handle table */ - GDIOBJ_vSetObjectAttr(&pbr->BaseObject, NULL); - - /* Free memory from the process gdi pool */ - ppi = PsGetCurrentProcessWin32Process(); - ASSERT(ppi); - GdiPoolFree(ppi->pPoolBrushAttr, pbr->pBrushAttr); -#endif - /* Reset to kmode brush attribute */ - pbr->pBrushAttr = &pbr->BrushAttr; } VOID Modified: trunk/reactos/win32ss/gdi/ntgdi/brush.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/brush.h?…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/brush.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/brush.h [iso-8859-1] Wed Feb 11 21:33:24 2015 @@ -32,12 +32,12 @@ ULONG ulPalTime; ULONG ulSurfTime; PVOID ulRealization; - ULONG Unknown4C[3]; + //ULONG Unknown4C[3]; POINT ptPenWidth; ULONG ulPenStyle; DWORD *pStyle; ULONG dwStyleCount; - ULONG Unknown6C; + //ULONG Unknown6C; } BRUSH, *PBRUSH; typedef struct _EBRUSHOBJ @@ -86,8 +86,6 @@ #define BR_CACHED_ENGINE 0x00040000 #define BR_CACHED_IS_SOLID 0x80000000 -#define BRUSH_AllocBrush() ((PBRUSH) GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) -#define BRUSH_AllocBrushWithHandle() ((PBRUSH) GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_BRUSH, sizeof(BRUSH))) #define BRUSH_FreeBrush(pBrush) GDIOBJ_FreeObj((POBJ)pBrush, GDIObjType_BRUSH_TYPE) #define BRUSH_FreeBrushByHandle(hBrush) GDIOBJ_FreeObjByHandle((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH) #define BRUSH_ShareLockBrush(hBrush) ((PBRUSH)GDIOBJ_ShareLockObj((HGDIOBJ)hBrush, GDI_OBJECT_TYPE_BRUSH)) Modified: trunk/reactos/win32ss/gdi/ntgdi/color.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/color.h?…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/color.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/color.h [iso-8859-1] Wed Feb 11 21:33:24 2015 @@ -1,8 +1,5 @@ #pragma once -#ifndef CLR_INVALID -#define CLR_INVALID 0xffffffff -#endif #define PC_SYS_USED 0x80 /* Palentry is used (both system and logical) */ #define PC_SYS_RESERVED 0x40 /* System palentry is not to be mapped to */ #define PC_SYS_MAPPED 0x10 /* Logical palentry is a direct alias for system palentry */ Modified: trunk/reactos/win32ss/gdi/ntgdi/pen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/pen.c?re…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/pen.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/pen.c [iso-8859-1] Wed Feb 11 21:33:24 2015 @@ -13,9 +13,52 @@ /* PRIVATE FUNCTIONS **********************************************************/ +static +VOID +PEN_vInit( + PPEN ppen) +{ + /* Start with kmode brush attribute */ + ppen->pBrushAttr = &ppen->BrushAttr; +} + +PBRUSH +NTAPI +PEN_AllocPenWithHandle( + VOID) +{ + PPEN ppen; + + ppen = (PBRUSH)GDIOBJ_AllocObjWithHandle(GDILoObjType_LO_PEN_TYPE, sizeof(PEN)); + if (ppen == NULL) + { + return NULL; + } + + PEN_vInit(ppen); + return ppen; +} + +PBRUSH +NTAPI +PEN_AllocExtPenWithHandle( + VOID) +{ + PPEN ppen; + + ppen = (PBRUSH)GDIOBJ_AllocObjWithHandle(GDILoObjType_LO_EXTPEN_TYPE, sizeof(PEN)); + if (ppen == NULL) + { + return NULL; + } + + PEN_vInit(ppen); + return ppen; +} + PBRUSH FASTCALL -PEN_ShareLockPen(HGDIOBJ hobj) +PEN_ShareLockPen(HPEN hobj) { if ((GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_PEN_TYPE) && (GDI_HANDLE_GET_TYPE(hobj) != GDILoObjType_LO_EXTPEN_TYPE)) Modified: trunk/reactos/win32ss/gdi/ntgdi/pen.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/pen.h?re…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/pen.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/pen.h [iso-8859-1] Wed Feb 11 21:33:24 2015 @@ -2,24 +2,28 @@ /* Internal interface */ -#define PEN_AllocPen() ((HPEN)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) -#define PEN_AllocPenWithHandle() ((PBRUSH)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_PEN, sizeof(BRUSH))) +typedef BRUSH PEN, *PPEN; -#define PEN_FreePen(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_BRUSH_TYPE) -#define PEN_FreePenByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_PEN) +PPEN +NTAPI +PEN_AllocPenWithHandle( + VOID); -#define PEN_AllocExtPen() ((PBRUSH)GDIOBJ_AllocObj(GDIObjType_BRUSH_TYPE)) -#define PEN_AllocExtPenWithHandle() ((PBRUSH)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_EXTPEN, sizeof(BRUSH))) - -#define PEN_FreeExtPen(pBMObj) GDIOBJ_FreeObj((POBJ) pBMObj, GDIObjType_BRUSH_TYPE) -#define PEN_FreeExtPenByHandle(hBMObj) GDIOBJ_FreeObjByHandle((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN) - -//#define PEN_LockExtPen(hBMObj) ((PBRUSH)GDIOBJ_LockObj((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_EXTPEN)) +PPEN +NTAPI +PEN_AllocExtPenWithHandle( + VOID); #define PEN_UnlockPen(pPenObj) GDIOBJ_vUnlockObject((POBJ)pPenObj) +#define PEN_ShareUnlockPen(ppen) GDIOBJ_vDereferenceObject((POBJ)ppen) -#define PEN_ShareUnlockPen(ppen) GDIOBJ_vDereferenceObject((POBJ)ppen) +PPEN +FASTCALL +PEN_ShareLockPen(HPEN hpen); -PBRUSH FASTCALL PEN_ShareLockPen(HGDIOBJ); - -INT APIENTRY PEN_GetObject(PBRUSH pPen, INT Count, PLOGPEN Buffer); +INT +NTAPI +PEN_GetObject( + _In_ PPEN pPen, + _In_ INT Count, + _Out_ PLOGPEN Buffer);
9 years, 10 months
1
0
0
0
[tkreuzer] 66225: [WIN32K] Fix ROP2 value coming from user mode before using it.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 11 21:32:54 2015 New Revision: 66225 URL:
http://svn.reactos.org/svn/reactos?rev=66225&view=rev
Log: [WIN32K] Fix ROP2 value coming from user mode before using it. Modified: trunk/reactos/win32ss/gdi/ntgdi/bitblt.c trunk/reactos/win32ss/gdi/ntgdi/intgdi.h Modified: trunk/reactos/win32ss/gdi/ntgdi/bitblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitblt.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/bitblt.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/bitblt.c [iso-8859-1] Wed Feb 11 21:32:54 2015 @@ -1150,7 +1150,7 @@ &prgnClip->rdh.rcBound ); /* Get the FG rop and create a MIX based on the BK mode */ - rop2Fg = pdc->pdcattr->jROP2; + rop2Fg = FIXUP_ROP2(pdc->pdcattr->jROP2); mix = rop2Fg | (pdc->pdcattr->jBkMode == OPAQUE ? rop2Fg : R2_NOP) << 8; /* Prepare DC for blit */ Modified: trunk/reactos/win32ss/gdi/ntgdi/intgdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/intgdi.h…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/intgdi.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/intgdi.h [iso-8859-1] Wed Feb 11 21:32:54 2015 @@ -4,6 +4,9 @@ #define ROP_USES_MASK(Rop) (((Rop) & 0xFF000000) != (((Rop) & 0xff0000) << 8)) #define FIXUP_ROP(Rop) if(((Rop) & 0xFF000000) == 0) Rop = MAKEROP4((Rop), (Rop)) #define ROP_TO_ROP4(Rop) ((Rop) >> 16) + +/* The range of valid ROP2 values is 1 .. 16 */ +#define FIXUP_ROP2(rop2) ((((rop2) - 1) & 0xF) + 1) /* Brush functions */
9 years, 10 months
1
0
0
0
[tkreuzer] 66224: [WIN32K] Simplify ROP4_USES_* macros
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Feb 11 21:32:24 2015 New Revision: 66224 URL:
http://svn.reactos.org/svn/reactos?rev=66224&view=rev
Log: [WIN32K] Simplify ROP4_USES_* macros Modified: trunk/reactos/win32ss/gdi/eng/inteng.h Modified: trunk/reactos/win32ss/gdi/eng/inteng.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/inteng.h?r…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/inteng.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/inteng.h [iso-8859-1] Wed Feb 11 21:32:24 2015 @@ -41,10 +41,10 @@ #define ROP4_FROM_INDEX(index) ((index) | ((index) << 8)) -#define ROP4_USES_SOURCE(Rop4) (((((Rop4) & 0xCC00) >> 2) != ((Rop4) & 0x3300)) || ((((Rop4) & 0xCC) >> 2) != ((Rop4) & 0x33))) -#define ROP4_USES_MASK(Rop4) (((Rop4) & 0xFF00) != (((Rop4) & 0xff) << 8)) -#define ROP4_USES_DEST(Rop4) (((((Rop4) & 0xAA) >> 1) != ((Rop4) & 0x55)) || ((((Rop4) & 0xAA00) >> 1) != ((Rop4) & 0x5500))) -#define ROP4_USES_PATTERN(Rop4) (((((Rop4) & 0xF0) >> 4) != ((Rop4) & 0x0F)) || ((((Rop4) & 0xF000) >> 4) != ((Rop4) & 0x0F00))) +#define ROP4_USES_DEST(Rop4) ((((Rop4) & 0xAAAA) >> 1) != ((Rop4) & 0x5555)) +#define ROP4_USES_SOURCE(Rop4) ((((Rop4) & 0xCCCC) >> 2) != ((Rop4) & 0x3333)) +#define ROP4_USES_PATTERN(Rop4) ((((Rop4) & 0xF0F0) >> 4) != ((Rop4) & 0x0F0F)) +#define ROP4_USES_MASK(Rop4) ((((Rop4) & 0xFF00) >> 8) != ((Rop4) & 0x00ff)) #define IS_VALID_ROP4(rop) (((rop) & 0xFFFF0000) == 0)
9 years, 10 months
1
0
0
0
[hbelusca] 66223: [WIN32K]: Fix an insecure user buffer reading/writing. Caught by Thomas Faber, thanks! CORE-8322
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Feb 11 20:12:30 2015 New Revision: 66223 URL:
http://svn.reactos.org/svn/reactos?rev=66223&view=rev
Log: [WIN32K]: Fix an insecure user buffer reading/writing. Caught by Thomas Faber, thanks! CORE-8322 Modified: trunk/reactos/win32ss/user/ntuser/ntstubs.c Modified: trunk/reactos/win32ss/user/ntuser/ntstubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/ntstub…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] Wed Feb 11 20:12:30 2015 @@ -790,6 +790,8 @@ { case UserThreadInitiateShutdown: { + ULONG CapturedFlags = 0; + ERR("Shutdown initiated\n"); if (ThreadInformationLength != sizeof(ULONG)) @@ -798,7 +800,33 @@ break; } - Status = UserInitiateShutdown(Thread, (PULONG)ThreadInformation); + /* Capture the caller value */ + Status = STATUS_SUCCESS; + _SEH2_TRY + { + ProbeForWrite(ThreadInformation, sizeof(CapturedFlags), sizeof(PVOID)); + CapturedFlags = *(PULONG)ThreadInformation; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (NT_SUCCESS(Status)) + Status = UserInitiateShutdown(Thread, &CapturedFlags); + + /* Return the modified value to the caller */ + _SEH2_TRY + { + *(PULONG)ThreadInformation = CapturedFlags; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + break; } @@ -814,6 +842,7 @@ break; } + /* Capture the caller value */ Status = STATUS_SUCCESS; _SEH2_TRY { @@ -844,6 +873,7 @@ break; } + /* Capture the caller value */ Status = STATUS_SUCCESS; _SEH2_TRY {
9 years, 10 months
1
0
0
0
[tfaber] 66222: [SHELL32] - Show a confirmation dialog when emptying the recycle bin. Patch by Robert Naumann, with some modifications by me. CORE-9006 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Feb 11 11:06:12 2015 New Revision: 66222 URL:
http://svn.reactos.org/svn/reactos?rev=66222&view=rev
Log: [SHELL32] - Show a confirmation dialog when emptying the recycle bin. Patch by Robert Naumann, with some modifications by me. CORE-9006 #resolve Modified: trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp Modified: trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/…
============================================================================== --- trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/CRecycleBin.cpp [iso-8859-1] Wed Feb 11 11:06:12 2015 @@ -1415,7 +1415,7 @@ DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) { TRACE("(%p) object dropped on recycle bin, effect %u\n", this, *pdwEffect); - + /* TODO: pdwEffect should be read and make the drop object be permanently deleted in the move case (shift held) */ FORMATETC fmt; @@ -1430,7 +1430,7 @@ } else { - /* + /* * TODO call SetData on the data object with format CFSTR_TARGETCLSID * set to the Recycle Bin's class identifier CLSID_RecycleBin. */ @@ -1438,7 +1438,7 @@ return S_OK; } -DWORD WINAPI DoDeleteThreadProc(LPVOID lpParameter) +DWORD WINAPI DoDeleteThreadProc(LPVOID lpParameter) { CoInitialize(NULL); CComPtr<IDataObject> pDataObject; @@ -1451,7 +1451,7 @@ return 0; } -HRESULT WINAPI DoDeleteDataObject(IDataObject *pda) +HRESULT WINAPI DoDeleteDataObject(IDataObject *pda) { TRACE("performing delete"); HRESULT hr; @@ -1499,7 +1499,7 @@ { psfFrom = psfDesktop; } - else + else { hr = psfDesktop->BindToObject(pidl, NULL, IID_PPV_ARG(IShellFolder, &psfFrom)); if (FAILED(hr)) @@ -1603,19 +1603,80 @@ HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags) { - WCHAR szPath[MAX_PATH] = {0}; - DWORD dwSize, dwType; + WCHAR szPath[MAX_PATH] = {0}, szBuffer[MAX_PATH]; + DWORD dwSize, dwType, count; LONG ret; + IShellFolder *pDesktop, *pRecycleBin; + PIDLIST_ABSOLUTE pidlRecycleBin; + PITEMID_CHILD pidl; + HRESULT hr = S_OK; + LPENUMIDLIST penumFiles; + STRRET StrRet; TRACE("%p, %s, 0x%08x\n", hwnd, debugstr_w(pszRootPath), dwFlags); if (!(dwFlags & SHERB_NOCONFIRMATION)) { - /* FIXME - * enumerate available files - * show confirmation dialog - */ - FIXME("show confirmation dialog\n"); + hr = SHGetDesktopFolder(&pDesktop); + if (FAILED(hr)) + return hr; + hr = SHGetFolderLocation(NULL, CSIDL_BITBUCKET, NULL, 0, &pidlRecycleBin); + if (FAILED(hr)) + { + pDesktop->Release(); + return hr; + } + hr = pDesktop->BindToObject(pidlRecycleBin, NULL, IID_PPV_ARG(IShellFolder, &pRecycleBin)); + CoTaskMemFree(pidlRecycleBin); + pDesktop->Release(); + if (FAILED(hr)) + return hr; + hr = pRecycleBin->EnumObjects(hwnd, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &penumFiles); + if (FAILED(hr)) + { + pRecycleBin->Release(); + return hr; + } + + count = 0; + if (hr != S_FALSE) + { + while (penumFiles->Next(1, &pidl, NULL) == S_OK) + { + count++; + pRecycleBin->GetDisplayNameOf(pidl, SHGDN_NORMAL, &StrRet); + StrRetToBuf(&StrRet, pidl, szBuffer, _countof(szBuffer)); + CoTaskMemFree(pidl); + } + penumFiles->Release(); + } + pRecycleBin->Release(); + + switch (count) + { + case 0: + /* no files, don't need confirmation */ + break; + + case 1: + /* we have only one item inside the bin, so show a message box with its name */ + if (ShellMessageBoxW(shell32_hInstance, hwnd, MAKEINTRESOURCEW(IDS_DELETEITEM_TEXT), MAKEINTRESOURCEW(IDS_EMPTY_BITBUCKET), + MB_ICONEXCLAMATION | MB_YESNO | MB_DEFBUTTON2, szBuffer) == IDNO) + { + return S_OK; + } + break; + + default: + /* we have more than one item, so show a message box with the count of the items */ + StringCbPrintfW(szBuffer, sizeof(szBuffer), L"%u", count); + if (ShellMessageBoxW(shell32_hInstance, hwnd, MAKEINTRESOURCEW(IDS_DELETEMULTIPLE_TEXT), MAKEINTRESOURCEW(IDS_EMPTY_BITBUCKET), + MB_ICONEXCLAMATION | MB_YESNO | MB_DEFBUTTON2, szBuffer) == IDNO) + { + return S_OK; + } + break; + } } if (dwFlags & SHERB_NOPROGRESSUI)
9 years, 10 months
1
0
0
0
[tkreuzer] 66221: [GDI32_APITEST] Add more tests for MaskBlt
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Feb 10 22:33:19 2015 New Revision: 66221 URL:
http://svn.reactos.org/svn/reactos?rev=66221&view=rev
Log: [GDI32_APITEST] Add more tests for MaskBlt Modified: trunk/rostests/apitests/gdi32/MaskBlt.c Modified: trunk/rostests/apitests/gdi32/MaskBlt.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/MaskBlt.c?…
============================================================================== --- trunk/rostests/apitests/gdi32/MaskBlt.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/MaskBlt.c [iso-8859-1] Tue Feb 10 22:33:19 2015 @@ -9,6 +9,7 @@ #include <wingdi.h> #include <winuser.h> +#include "init.h" void Test_MaskBlt_1bpp() { @@ -42,7 +43,7 @@ pjBitsMsk[0] = 0xF0; ret = MaskBlt(hdcDst, 0, 0, 8, 1, hdcSrc, 0, 0, hbmMsk, 0, 0, MAKEROP4(SRCCOPY, 0xAA0000)); ok(ret == 1, "MaskBlt failed (%d)\n", ret); - ok (pjBitsDst[0] == 0xCA, "pjBitsDst[0] == 0x%x\n", pjBitsDst[0]); + ok(pjBitsDst[0] == 0xCA, "pjBitsDst[0] == 0x%x\n", pjBitsDst[0]); pjBitsDst[0] = 0x00; pjBitsSrc[0] = 0xFF; @@ -52,9 +53,10 @@ ok (pjBitsDst[0] == 0xF0, "pjBitsDst[0] == 0x%x\n", pjBitsDst[0]); /* Do the masking (NOTSRCERASE / SRCINVERT) */ - pjBitsDst[0] = 0xF0; - pjBitsSrc[0] = 0xCC; - pjBitsMsk[0] = 0xAA; + pjBitsDst[0] = 0xF0; // 11110000 + pjBitsSrc[0] = 0xCC; // 11001100 + pjBitsMsk[0] = 0xAA; // 10101010 + ret = MaskBlt(hdcDst, 0, 0, 8, 1, hdcSrc, 0, 0, hbmMsk, 0, 0, MAKEROP4(NOTSRCERASE, SRCINVERT)); // 22 ok(ret == 1, "MaskBlt failed (%d)\n", ret); ok (pjBitsDst[0] == 0x16, "pjBitsDst[0] == 0x%x\n", pjBitsDst[0]); @@ -66,6 +68,28 @@ ret = MaskBlt(hdcDst, 0, 0, 8, 1, hdcSrc, 0, 0, hbmMsk, 0, 0, MAKEROP4(MERGEPAINT, 0x990000)); ok(ret == 1, "MaskBlt failed (%d)\n", ret); ok (pjBitsDst[0] == 0xE3, "pjBitsDst[0] == 0x%x\n", pjBitsDst[0]); + + /* Try a ROP that needs a mask with a NULL mask bitmap handle */ + ret = MaskBlt(hdcDst, 0, 0, 8, 1, hdcSrc, 0, 0, NULL, 0, 0, MAKEROP4(SRCCOPY, 0xAA0000)); + ok(ret == 1, "MaskBlt failed (%d)\n", ret); + ok(pjBitsDst[0] == 0xCC, "pjBitsDst[0] == 0x%x\n", pjBitsDst[0]); + + /* Try a ROP that needs a mask with an invalid mask bitmap handle */ + ret = MaskBlt(hdcDst, 0, 0, 8, 1, hdcSrc, 0, 0, (HBITMAP)0x123456, 0, 0, MAKEROP4(SRCCOPY, 0xAA0000)); + ok(ret == 0, "MaskBlt should fail, but succeeded (%d)\n", ret); + + /* Try a ROP that needs a mask with an invalid mask bitmap */ + ok(ghbmp24 != NULL, "ghbmp24 is NULL!\n"); + ret = MaskBlt(hdcDst, 0, 0, 8, 1, hdcSrc, 0, 0, ghbmp24, 0, 0, MAKEROP4(SRCCOPY, 0xAA0000)); + ok(ret == 0, "MaskBlt should fail, but succeeded (%d)\n", ret); + + /* Try a ROP that needs no mask with an invalid mask bitmap */ + ret = MaskBlt(hdcDst, 0, 0, 8, 1, hdcSrc, 0, 0, (HBITMAP)0x123456, 0, 0, MAKEROP4(SRCCOPY, SRCCOPY)); + ok(ret == 1, "MaskBlt failed (%d)\n", ret); + + /* Try (PATCOPY / NOOP) with a NULL source mask and bitmap */ + ret = MaskBlt(hdcDst, 0, 0, 8, 1, NULL, 0, 0, NULL, 0, 0, MAKEROP4(PATCOPY, 0xAA0000)); + ok(ret == 0, "MaskBlt should fail, but succeeded (%d)\n", ret); } @@ -159,6 +183,7 @@ START_TEST(MaskBlt) { + InitStuff(); Test_MaskBlt_1bpp(); switch (GetDeviceCaps(GetDC(NULL), BITSPIXEL)) {
9 years, 10 months
1
0
0
0
[tkreuzer] 66220: [GDI32_APITEST] Add more helper code
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue Feb 10 22:31:17 2015 New Revision: 66220 URL:
http://svn.reactos.org/svn/reactos?rev=66220&view=rev
Log: [GDI32_APITEST] Add more helper code Modified: trunk/rostests/apitests/gdi32/init.c trunk/rostests/apitests/gdi32/init.h Modified: trunk/rostests/apitests/gdi32/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/init.c?rev…
============================================================================== --- trunk/rostests/apitests/gdi32/init.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/init.c [iso-8859-1] Tue Feb 10 22:31:17 2015 @@ -2,21 +2,18 @@ #include <stdio.h> #include <windef.h> #include <wingdi.h> +#include "init.h" -HBITMAP ghbmpDIB32; -HDC ghdcDIB32; +HBITMAP ghbmp1, ghbmp4, ghbmp8, ghbmp16, ghbmp24, ghbmp32; +HDC ghdcBmp1, ghdcBmp4, ghdcBmp8, ghdcBmp16, ghdcBmp24, ghdcBmp32; +HBITMAP ghbmpDIB1, ghbmpDIB4, ghbmpDIB8, ghbmpDIB16, ghbmpDIB24, ghbmpDIB32; +HDC ghdcDIB1, ghdcDIB4, ghdcDIB8, ghdcDIB16, ghdcDIB24, ghdcDIB32; +PVOID gpvDIB1, gpvDIB4, gpvDIB8, gpvDIB16, gpvDIB24, gpvDIB32; PULONG pulDIB32Bits; -HBITMAP ghbmpDIB4; -HDC ghdcDIB4; PULONG pulDIB4Bits; HPALETTE ghpal; -struct -{ - WORD palVersion; - WORD palNumEntries; - PALETTEENTRY logpalettedata[8]; -} gpal = +MYPAL gpal = { 0x300, 8, { @@ -31,23 +28,77 @@ } }; +BOOL +InitPerBitDepth( + _In_ ULONG cBitsPerPixel, + _In_ ULONG cx, + _In_ ULONG cy, + _Out_ HDC *phdcBmp, + _Out_ HBITMAP *phbmp, + _Out_ HDC *phdcDIB, + _Out_ HBITMAP *phbmpDIB, + _Out_ PVOID *ppvBits) +{ + struct + { + BITMAPCOREHEADER bmiHeader; + RGBQUAD bmiColors[256]; + } bmiBuffer; + LPBITMAPINFO pbmi = (LPBITMAPINFO)&bmiBuffer; + + /* Create a compatible DC for the bitmap */ + *phdcBmp = CreateCompatibleDC(0); + if (*phdcBmp == NULL) + { + printf("CreateCompatibleDC failed for %lu bpp\n", cBitsPerPixel); + return FALSE; + } + + /* Create a bitmap */ + *phbmp = CreateBitmap(cx, cy, 1, cBitsPerPixel, NULL); + if (*phbmp == NULL) + { + printf("CreateBitmap failed %lu\n", cBitsPerPixel); + return FALSE; + } + + SelectObject(*phdcBmp, *phbmp); + + /* Get info about the bitmap */ + memset(&bmiBuffer, 0, sizeof(bmiBuffer)); + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + if (!GetDIBits(*phdcBmp, *phbmp, 0, 1, NULL, pbmi, DIB_RGB_COLORS)) + { + printf("GetDIBits failed %lu\n", cBitsPerPixel); + return FALSE; + } + + /* Create a compatible DC for the DIB */ + *phdcDIB = CreateCompatibleDC(0); + if (*phdcDIB == NULL) + { + printf("CreateCompatibleDC failed %lu\n", cBitsPerPixel); + return FALSE; + } + + pbmi->bmiHeader.biCompression = BI_RGB; + pbmi->bmiHeader.biHeight = -pbmi->bmiHeader.biHeight; + + /* Create the DIB section with the same values */ + *phbmpDIB = CreateDIBSection(*phdcDIB, pbmi, DIB_RGB_COLORS, ppvBits, 0, 0 ); + if (*phbmpDIB == NULL) + { + printf("CreateDIBSection failed. %lu\n", cBitsPerPixel); + return FALSE; + } + + SelectObject(*phdcDIB, *phbmpDIB); + + return TRUE; +} + BOOL InitStuff(void) { - BITMAPINFO bmi32 = - {{sizeof(BITMAPINFOHEADER), 4, -4, 1, 32, BI_RGB, 0, 1, 1, 0, 0}}; - BITMAPINFO bmi4 = - {{sizeof(BITMAPINFOHEADER), 4, -4, 1, 4, BI_RGB, 0, 1, 1, 0, 0}}; - - ghdcDIB32 = CreateCompatibleDC(0); - ghdcDIB4 = CreateCompatibleDC(0); - - ghbmpDIB32 = CreateDIBSection(ghdcDIB32, &bmi32, DIB_PAL_COLORS, (PVOID*)&pulDIB32Bits, 0, 0 ); - if (!ghbmpDIB32) return FALSE; - - ghbmpDIB4 = CreateDIBSection(ghdcDIB4, &bmi4, DIB_PAL_COLORS, (PVOID*)&pulDIB4Bits, 0, 0 ); - if (!ghbmpDIB32) return FALSE; - - SelectObject(ghdcDIB32, ghbmpDIB32); /* Initialize a logical palette */ ghpal = CreatePalette((LOGPALETTE*)&gpal); @@ -57,5 +108,19 @@ return FALSE; } + if (!InitPerBitDepth(1, 9, 9, &ghdcBmp1, &ghbmp1, &ghdcDIB1, &ghbmpDIB1, &gpvDIB1) || + !InitPerBitDepth(4, 5, 5, &ghdcBmp4, &ghbmp4, &ghdcDIB4, &ghbmpDIB4, &gpvDIB4) || + !InitPerBitDepth(8, 5, 5, &ghdcBmp8, &ghbmp8, &ghdcDIB8, &ghbmpDIB8, &gpvDIB8) || + !InitPerBitDepth(16, 5, 5, &ghdcBmp16, &ghbmp16, &ghdcDIB16, &ghbmpDIB16, &gpvDIB16) || + !InitPerBitDepth(24, 5, 5, &ghdcBmp24, &ghbmp24, &ghdcDIB24, &ghbmpDIB24, &gpvDIB24) || + !InitPerBitDepth(32, 4, 4, &ghdcBmp32, &ghbmp32, &ghdcDIB32, &ghbmpDIB32, &gpvDIB32)) + { + printf("failed to create objects \n"); + return FALSE; + } + + pulDIB32Bits = gpvDIB32; + pulDIB4Bits = gpvDIB4; + return TRUE; } Modified: trunk/rostests/apitests/gdi32/init.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/init.h?rev…
============================================================================== --- trunk/rostests/apitests/gdi32/init.h [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/init.h [iso-8859-1] Tue Feb 10 22:31:17 2015 @@ -1,16 +1,22 @@ + +extern HBITMAP ghbmp1, ghbmp4, ghbmp8, ghbmp16, ghbmp24, ghbmp32; +extern HDC ghdcBmp1, ghdcBmp4, ghdcBmp8, ghdcBmp16, ghdcBmp24, ghdcBmp32; +extern HBITMAP ghbmpDIB1, ghbmpDIB4, ghbmpDIB8, ghbmpDIB16, ghbmpDIB24, ghbmpDIB32; +extern HDC ghdcDIB1, ghdcDIB4, ghdcDIB8, ghdcDIB16, ghdcDIB24, ghdcDIB32; +extern PVOID pvBits1Bpp, pvBits4Bpp, pvBits8Bpp, pvBits16Bpp, pvBits24Bpp, pvBits32Bpp; extern HBITMAP ghbmpDIB32; -extern HDC ghdcDIB32; extern PULONG pulDIB32Bits; -extern HBITMAP ghbmpDIB4; -extern HDC ghdcDIB4; extern PULONG pulDIB4Bits; extern HPALETTE ghpal; -extern struct +typedef struct { - LOGPALETTE logpal; + WORD palVersion; + WORD palNumEntries; PALETTEENTRY logpalettedata[8]; -} gpal; +} MYPAL; + +extern MYPAL gpal; BOOL InitStuff(void);
9 years, 10 months
1
0
0
0
[dreimer] 66219: [BROWSEUI] Fix german layout to... look better.
by dreimer@svn.reactos.org
Author: dreimer Date: Tue Feb 10 21:02:11 2015 New Revision: 66219 URL:
http://svn.reactos.org/svn/reactos?rev=66219&view=rev
Log: [BROWSEUI] Fix german layout to... look better. Modified: trunk/reactos/dll/win32/browseui/lang/de-DE.rc Modified: trunk/reactos/dll/win32/browseui/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/de…
============================================================================== --- trunk/reactos/dll/win32/browseui/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/browseui/lang/de-DE.rc [iso-8859-1] Tue Feb 10 21:02:11 2015 @@ -125,10 +125,10 @@ STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - LTEXT "Te&xt Optionen:", -1, 4, 2, 48, 15 - COMBOBOX IDC_TEXTOPTIONS, 52, 0, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Symboloptio&nen:", -1, 4, 20, 48, 15 - COMBOBOX IDC_ICONOPTIONS, 52, 18, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Te&xtoptionen:", -1, 4, 2, 53, 15 + COMBOBOX IDC_TEXTOPTIONS, 60, 0, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Symboloptio&nen:", -1, 4, 20, 53, 15 + COMBOBOX IDC_ICONOPTIONS, 60, 18, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END /* Accelerators */ @@ -155,7 +155,7 @@ STRINGTABLE BEGIN IDS_CANCELLING "Abbrechen..." - IDS_REMAINING "Ãbrig" + IDS_REMAINING "Verbleibend" END STRINGTABLE
9 years, 10 months
1
0
0
0
[tfaber] 66218: [GDI32_APITEST] - Fix flakiness in GetDIBits test
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Feb 10 20:29:54 2015 New Revision: 66218 URL:
http://svn.reactos.org/svn/reactos?rev=66218&view=rev
Log: [GDI32_APITEST] - Fix flakiness in GetDIBits test Modified: trunk/rostests/apitests/gdi32/GetDIBits.c Modified: trunk/rostests/apitests/gdi32/GetDIBits.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetDIBits.…
============================================================================== --- trunk/rostests/apitests/gdi32/GetDIBits.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetDIBits.c [iso-8859-1] Tue Feb 10 20:29:54 2015 @@ -50,7 +50,7 @@ //ok_int(GetDIBits(NULL, hbmp, 0, 0, NULL, pbmi, DIB_RGB_COLORS), 1); /* Test a bitmap with values partly set */ - ZeroMemory(pbmi, sizeof(BITMAPINFO)); + ZeroMemory(pbmi, sizeof(ajBuffer)); pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbmi->bmiHeader.biWidth = 12; pbmi->bmiHeader.biHeight = 14; @@ -102,6 +102,7 @@ HDC hdcScreen, hdcMem; HBITMAP hbmp; PBITMAPINFO pbi; + DWORD bisize; PBITMAPCOREHEADER pbch; PBITMAPV5HEADER pbV5Header; INT ScreenBpp; @@ -109,7 +110,8 @@ PVOID pvBits; ULONG cjSizeImage; - pbi = malloc(sizeof(BITMAPV5HEADER) + 256 * sizeof(DWORD)); + bisize = sizeof(BITMAPV5HEADER) + 256 * sizeof(DWORD); + pbi = malloc(bisize); pbch = (PVOID)pbi; pbV5Header = (PVOID)pbi; @@ -145,21 +147,21 @@ /* null hdc */ SetLastError(ERROR_SUCCESS); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ok(GetDIBits(NULL, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) == 0, "\n"); ok_err(ERROR_INVALID_PARAMETER); /* null bitmap */ SetLastError(ERROR_SUCCESS); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ok(GetDIBits(hdcScreen, NULL, 0, 15, NULL, pbi, DIB_RGB_COLORS) == 0, "\n"); ok_err(ERROR_SUCCESS); /* 0 scan lines */ SetLastError(ERROR_SUCCESS); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ok(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS) > 0, "\n"); ok_err(ERROR_SUCCESS); @@ -171,7 +173,7 @@ /* bad bmi colours (uUsage) */ SetLastError(0); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, 100) == 0, "\n"); ok_err(ERROR_SUCCESS); @@ -182,7 +184,7 @@ /* basic call */ SetLastError(ERROR_SUCCESS); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ok(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS) > 0, "\n"); ok_err(ERROR_SUCCESS); @@ -193,7 +195,7 @@ ok(pbi->bmiHeader.biSizeImage == (16 * 16) * (ScreenBpp / 8), "\n"); /* Test if COREHEADER is supported */ - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPCOREHEADER); ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); ok_int(pbi->bmiHeader.biSize, sizeof(BITMAPCOREHEADER)); @@ -203,27 +205,27 @@ //ok_int(pbch->bcBitCount, ScreenBpp > 16 ? 24 : ScreenBpp); // fails on XP with screenbpp == 16 /* Test different header sizes */ - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPCOREHEADER) + 4; ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 0); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER) + 4; ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPV4HEADER); ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPV4HEADER) + 4; ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPV5HEADER); ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPV5HEADER) + 4; ok_int(GetDIBits(hdcScreen, hbmp, 0, 15, NULL, pbi, DIB_RGB_COLORS), 1); ok_int(pbV5Header->bV5RedMask, 0); @@ -240,7 +242,7 @@ ok_int(pbV5Header->bV5ProfileSize, 0); ok_int(pbV5Header->bV5Reserved, 0); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ok_int(GetDIBits(hdcScreen, hbmp, 234, 43, NULL, pbi, DIB_RGB_COLORS), 1); @@ -249,7 +251,7 @@ /* Test a mono bitmap */ hbmp = CreateBitmap(13, 7, 1, 1, ajBits); ok(hbmp != 0, "failed to create bitmap\n"); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ok_int(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS), 1); ok_int(pbi->bmiHeader.biWidth, 13); @@ -280,32 +282,32 @@ /* Set bitmap dimensions */ ok_int(SetBitmapDimensionEx(hbmp, 110, 220, NULL), 1); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); ok_int(pbi->bmiHeader.biXPelsPerMeter, 0); ok_int(pbi->bmiHeader.biYPelsPerMeter, 0); /* Set individual values */ - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbi->bmiHeader.biWidth = 12; ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); ok_int(pbi->bmiHeader.biWidth, 13); ok_int(pbi->bmiHeader.biSizeImage, 28); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbi->bmiHeader.biSizeImage = 123; ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbi->bmiHeader.biCompression = BI_RGB; ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 1); /* Set only biBitCount */ - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbi->bmiHeader.biBitCount = 5; ok_int(GetDIBits(hdcScreen, hbmp, 0, 5, NULL, pbi, DIB_RGB_COLORS), 0); @@ -384,7 +386,7 @@ ok_int(GetDIBits(hdcScreen, hbmp, 0, 4, pvBits, pbi, DIB_RGB_COLORS), 4); /* Set only biBitCount and pjInit */ - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbi->bmiHeader.biBitCount = 5; ok_int(GetDIBits(hdcScreen, hbmp, 0, 4, pvBits, pbi, DIB_RGB_COLORS), 0); @@ -395,7 +397,7 @@ /* Test a 4 bpp bitmap */ hbmp = CreateBitmap(3, 5, 1, 4, NULL); ok(hbmp != 0, "failed to create bitmap\n"); - ZeroMemory(pbi, sizeof(BITMAPINFO)); + ZeroMemory(pbi, bisize); pbi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); ok_int(GetDIBits(hdcScreen, hbmp, 0, 0, NULL, pbi, DIB_RGB_COLORS), 1); ok_int(pbi->bmiHeader.biWidth, 3);
9 years, 10 months
1
0
0
0
← Newer
1
...
26
27
28
29
30
31
32
...
38
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
Results per page:
10
25
50
100
200