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
May 2012
----- 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
12 participants
227 discussions
Start a n
N
ew thread
[jimtabor] 56501: - Add notification alerts.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sat May 5 00:03:50 2012 New Revision: 56501 URL:
http://svn.reactos.org/svn/reactos?rev=56501&view=rev
Log: - Add notification alerts. Modified: trunk/reactos/include/psdk/winuser.h Modified: trunk/reactos/include/psdk/winuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winuser.h?rev…
============================================================================== --- trunk/reactos/include/psdk/winuser.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winuser.h [iso-8859-1] Sat May 5 00:03:50 2012 @@ -2669,6 +2669,12 @@ #define EVENT_OBJECT_HELPCHANGE 0x00008010 #define EVENT_OBJECT_DEFACTIONCHANGE 0x00008011 #define EVENT_OBJECT_ACCELERATORCHANGE 0x00008012 +#define ALERT_SYSTEM_INFORMATIONAL 1 /* MB_INFORMATION */ +#define ALERT_SYSTEM_WARNING 2 /* MB_WARNING */ +#define ALERT_SYSTEM_ERROR 3 /* MB_ERROR */ +#define ALERT_SYSTEM_QUERY 4 /* MB_QUESTION */ +#define ALERT_SYSTEM_CRITICAL 5 /* HardSysErrBox */ +#define CALERT_SYSTEM 6 #if (_WIN32_WINNT >= 0x0501) #define EVENT_CONSOLE_CARET 0x00004001 #define CONSOLE_CARET_SELECTION 0x00000001
12 years, 7 months
1
0
0
0
[tkreuzer] 56500: [TESTS] Add missing definition
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 4 19:06:15 2012 New Revision: 56500 URL:
http://svn.reactos.org/svn/reactos?rev=56500&view=rev
Log: [TESTS] Add missing definition Modified: trunk/reactos/include/reactos/wine/test.h Modified: trunk/reactos/include/reactos/wine/test.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.…
============================================================================== --- trunk/reactos/include/reactos/wine/test.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/wine/test.h [iso-8859-1] Fri May 4 19:06:15 2012 @@ -639,6 +639,13 @@ #expression, (int)(result), _value); \ } +#define ok_ptr(expression, result) \ + { \ + void *_value = (expression); \ + ok(_value == (result), "Wrong value for '%s', expected: " #result " (%p), got: %p\n", \ + #expression, (void*)(result), _value); \ + } + #define ok_err(error) \ ok(GetLastError() == (error), "Wrong last error. Expected " #error ", got %d\n", (int)GetLastError()) @@ -648,5 +655,6 @@ #define ok_long(expression, result) ok_hex(expression, result) #define ok_int(expression, result) ok_dec(expression, result) #define ok_ntstatus(status, expected) ok_hex(status, expected) +#define ok_hdl ok_ptr #endif /* __WINE_WINE_TEST_H */
12 years, 7 months
1
0
0
0
[tkreuzer] 56499: [GDI32_APITEST] Fix warnings
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 4 19:06:12 2012 New Revision: 56499 URL:
http://svn.reactos.org/svn/reactos?rev=56499&view=rev
Log: [GDI32_APITEST] Fix warnings Modified: trunk/rostests/apitests/gdi32/CreateDIBPatternBrush.c trunk/rostests/apitests/gdi32/GetObject.c trunk/rostests/apitests/gdi32/init.c Modified: trunk/rostests/apitests/gdi32/CreateDIBPatternBrush.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CreateDIBP…
============================================================================== --- trunk/rostests/apitests/gdi32/CreateDIBPatternBrush.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/CreateDIBPatternBrush.c [iso-8859-1] Fri May 4 19:06:12 2012 @@ -29,7 +29,6 @@ {0, 1, 2, 7}, {0,1,2,3, 1,2,3,0, 2,3,0,1, 3,0,1,2}, }; - PBITMAPINFO pbmi = (PBITMAPINFO)&PackedDIB; HBRUSH hbr, hbrOld; HPALETTE hpalOld; Modified: trunk/rostests/apitests/gdi32/GetObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetObject.…
============================================================================== --- trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] Fri May 4 19:06:12 2012 @@ -349,7 +349,6 @@ {1, 7, 3, 1}, {0,1,2,3, 1,2,3,0, 2,3,0,1, 3,0,1,2}, }; - PBITMAPINFO pbmi = (PBITMAPINFO)&PackedDIB; LOGBRUSH logbrush; HBRUSH hBrush; 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] Fri May 4 19:06:12 2012 @@ -30,7 +30,7 @@ BOOL InitStuff(void) { BITMAPINFO bmi32 = - {{sizeof(BITMAPINFOHEADER), 4, -4, 1, 32, BI_RGB, 0, 1, 1, 0, 0}, {0}}; + {{sizeof(BITMAPINFOHEADER), 4, -4, 1, 32, BI_RGB, 0, 1, 1, 0, 0}}; ghdcDIB32 = CreateCompatibleDC(0);
12 years, 7 months
1
0
0
0
[tkreuzer] 56498: [GDI32_APITEST] - Add tests for CreateDIBPatternBrush(Pt) - Add some helper code to initialize a dibsection and a palette, which can be reused by other tests - Add tests for DIB b...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 4 18:56:43 2012 New Revision: 56498 URL:
http://svn.reactos.org/svn/reactos?rev=56498&view=rev
Log: [GDI32_APITEST] - Add tests for CreateDIBPatternBrush(Pt) - Add some helper code to initialize a dibsection and a palette, which can be reused by other tests - Add tests for DIB brush in GetObject Added: trunk/rostests/apitests/gdi32/CreateDIBPatternBrush.c (with props) trunk/rostests/apitests/gdi32/init.c (with props) trunk/rostests/apitests/gdi32/init.h (with props) Modified: trunk/rostests/apitests/gdi32/CMakeLists.txt trunk/rostests/apitests/gdi32/GetObject.c trunk/rostests/apitests/gdi32/testlist.c Modified: trunk/rostests/apitests/gdi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CMakeLists…
============================================================================== --- trunk/rostests/apitests/gdi32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/CMakeLists.txt [iso-8859-1] Fri May 4 18:56:43 2012 @@ -12,6 +12,7 @@ CreateBitmapIndirect.c CreateCompatibleDC.c CreateDIBitmap.c + CreateDIBPatternBrush CreateFont.c CreateFontIndirect.c CreateIconIndirect.c @@ -57,6 +58,7 @@ SetSysColors.c SetWindowExtEx.c SetWorldTransform.c + init.c testlist.c) add_executable(gdi32_apitest ${SOURCE}) Added: trunk/rostests/apitests/gdi32/CreateDIBPatternBrush.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CreateDIBP…
============================================================================== --- trunk/rostests/apitests/gdi32/CreateDIBPatternBrush.c (added) +++ trunk/rostests/apitests/gdi32/CreateDIBPatternBrush.c [iso-8859-1] Fri May 4 18:56:43 2012 @@ -1,0 +1,147 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for CreateDIBPatternBrush + * PROGRAMMERS: Timo Kreuzer + */ + +#include <stdio.h> +#include <wine/test.h> +#include <windows.h> +#include "init.h" + + +void Test_CreateDIBPatternBrush() +{ + +} + +void Test_CreateDIBPatternBrushPt() +{ + struct + { + BITMAPINFOHEADER bmiHeader; + WORD wColors[4]; + BYTE ajBuffer[16]; + } PackedDIB = + { + {sizeof(BITMAPINFOHEADER), 4, -4, 1, 8, BI_RGB, 0, 1, 1, 4, 0}, + {0, 1, 2, 7}, + {0,1,2,3, 1,2,3,0, 2,3,0,1, 3,0,1,2}, + }; + PBITMAPINFO pbmi = (PBITMAPINFO)&PackedDIB; + HBRUSH hbr, hbrOld; + HPALETTE hpalOld; + + SetLastError(0); + ok_hdl(CreateDIBPatternBrushPt(NULL, 0), NULL); + ok_hdl(CreateDIBPatternBrushPt(NULL, DIB_PAL_COLORS), NULL); + ok_hdl(CreateDIBPatternBrushPt(NULL, 2), NULL); + ok_hdl(CreateDIBPatternBrushPt(NULL, 3), NULL); + ok_err(0); + + hbr = CreateDIBPatternBrushPt(&PackedDIB, 0); + ok(hbr != 0, "Expected success\n"); + DeleteObject(hbr); + hbr = CreateDIBPatternBrushPt(&PackedDIB, 2); + ok(hbr != 0, "Expected success\n"); + DeleteObject(hbr); + + SetLastError(0); + hbr = CreateDIBPatternBrushPt(&PackedDIB, 3); + ok(hbr == 0, "Expected failure\n"); + ok_err(ERROR_INVALID_PARAMETER); + SetLastError(0); + hbr = CreateDIBPatternBrushPt(&PackedDIB, 10); + ok(hbr == 0, "Expected failure\n"); + ok_err(ERROR_INVALID_PARAMETER); + + /* Create a DIB brush with palette indices */ + hbr = CreateDIBPatternBrushPt(&PackedDIB, DIB_PAL_COLORS); + ok(hbr != 0, "CreateSolidBrush failed, skipping tests.\n"); + if (!hbr) return; + + /* Select the brush into the dc */ + hbrOld = SelectObject(ghdcDIB32, hbr); + + /* Copy it on the dib section */ + ok_long(PatBlt(ghdcDIB32, 0, 0, 4, 4, PATCOPY), 1); + ok_long(pulDIB32Bits[0], 0x000000); // 0 + ok_long(pulDIB32Bits[1], 0x800000); // 1 + ok_long(pulDIB32Bits[2], 0x008000); // 2 + ok_long(pulDIB32Bits[3], 0xc0c0c0); // 7 + + /* Select a logical palette into the DC */ + hpalOld = SelectPalette(ghdcDIB32, ghpal, FALSE); + ok(hpalOld != 0, "Expected success, error %ld\n", GetLastError()); + + /* Copy it on the dib section */ + ok_long(PatBlt(ghdcDIB32, 0, 0, 4, 4, PATCOPY), 1); + ok_long(pulDIB32Bits[0], 0x102030); // 0 + ok_long(pulDIB32Bits[1], 0x203040); // 1 + ok_long(pulDIB32Bits[2], 0x304050); // 2 + ok_long(pulDIB32Bits[3], 0x8090a0); // 7 + + /* Select back old palette and destroy the DIB data */ + SelectPalette(ghdcDIB32, hpalOld, FALSE); + memset(&PackedDIB.ajBuffer, 0x77, 4); + + /* Copy it on the dib section */ + ok_long(PatBlt(ghdcDIB32, 0, 0, 4, 4, PATCOPY), 1); + ok_long(pulDIB32Bits[0], 0x000000); // 0 + ok_long(pulDIB32Bits[1], 0x800000); // 1 + ok_long(pulDIB32Bits[2], 0x008000); // 2 + ok_long(pulDIB32Bits[3], 0xc0c0c0); // 7 + + SelectObject(ghdcDIB32, hbrOld); + DeleteObject(hbr); + + /* Set some different values */ + PackedDIB.ajBuffer[0] = 3; + PackedDIB.ajBuffer[1] = 2; + PackedDIB.ajBuffer[2] = 1; + PackedDIB.ajBuffer[3] = 0; + + /* Create a DIB brush with unkdocumented iUsage == 2 */ + hbr = CreateDIBPatternBrushPt(&PackedDIB, 2); + ok(hbr != 0, "CreateSolidBrush failed, skipping tests.\n"); + if (!hbr) return; + + /* Select the brush into the dc */ + hbrOld = SelectObject(ghdcDIB32, hbr); + ok(hbrOld != 0, "CreateSolidBrush failed, skipping tests.\n"); + + /* Copy it on a dib section */ + memset(pulDIB32Bits, 0x77, 64); + ok_long(PatBlt(ghdcDIB32, 0, 0, 4, 4, PATCOPY), 1); + ok_long(pulDIB32Bits[0], 0x77777777); + ok_long(pulDIB32Bits[1], 0x77777777); + ok_long(pulDIB32Bits[2], 0x77777777); + ok_long(pulDIB32Bits[3], 0x77777777); + + /* Select a logical palette into the DC */ + hpalOld = SelectPalette(ghdcDIB32, ghpal, FALSE); + ok(hpalOld != 0, "Expected success, error %ld\n", GetLastError()); + + /* Copy it on a dib section */ + ok_long(PatBlt(ghdcDIB32, 0, 0, 4, 4, PATCOPY), 1); + ok_long(pulDIB32Bits[0], 0x77777777); + ok_long(pulDIB32Bits[1], 0x77777777); + ok_long(pulDIB32Bits[2], 0x77777777); + ok_long(pulDIB32Bits[3], 0x77777777); + + SelectPalette(ghdcDIB32, hpalOld, FALSE); + SelectObject(ghdcDIB32, hbrOld); + DeleteObject(hbr); + +} + + +START_TEST(CreateDIBPatternBrush) +{ + InitStuff(); + + Test_CreateDIBPatternBrush(); + Test_CreateDIBPatternBrushPt(); +} + Propchange: trunk/rostests/apitests/gdi32/CreateDIBPatternBrush.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/gdi32/GetObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetObject.…
============================================================================== --- trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] Fri May 4 18:56:43 2012 @@ -216,7 +216,7 @@ void Test_Dibsection(void) { - BITMAPINFO bmi = {{sizeof(BITMAPINFOHEADER), 10, 9, 1, 8, BI_RGB, 0, 10, 10, 0,0}}; + BITMAPINFO bmi = {{sizeof(BITMAPINFOHEADER), 10, 9, 1, 16, BI_RGB, 0, 10, 10, 0,0}}; HBITMAP hBitmap; BITMAP bitmap; DIBSECTION dibsection; @@ -233,25 +233,25 @@ ok(GetObjectW((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP), "\n"); SetLastError(ERROR_SUCCESS); - ok(GetObject(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP), "\n"); - ok(GetObject(hBitmap, 0, NULL) == sizeof(BITMAP), "\n"); - ok(GetObject(hBitmap, 5, NULL) == sizeof(BITMAP), "\n"); - ok(GetObject(hBitmap, -5, NULL) == sizeof(BITMAP), "\n"); - ok(GetObject(hBitmap, 0, &dibsection) == 0, "\n"); - ok(GetObject(hBitmap, 5, &dibsection) == 0, "\n"); - ok(GetObject(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP), "\n"); - ok(GetObject(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP), "\n"); - ok(bitmap.bmType == 0, "\n"); - ok(bitmap.bmWidth == 10, "\n"); - ok(bitmap.bmHeight == 9, "\n"); - ok(bitmap.bmWidthBytes == 12, "\n"); - ok(bitmap.bmPlanes == 1, "\n"); - ok(bitmap.bmBitsPixel == 8, "\n"); + ok_long(GetObject(hBitmap, sizeof(DIBSECTION), NULL), sizeof(BITMAP)); + ok_long(GetObject(hBitmap, 0, NULL), sizeof(BITMAP)); + ok_long(GetObject(hBitmap, 5, NULL), sizeof(BITMAP)); + ok_long(GetObject(hBitmap, -5, NULL), sizeof(BITMAP)); + ok_long(GetObject(hBitmap, 0, &dibsection), 0); + ok_long(GetObject(hBitmap, 5, &dibsection), 0); + ok_long(GetObject(hBitmap, sizeof(BITMAP), &bitmap), sizeof(BITMAP)); + ok_long(GetObject(hBitmap, sizeof(BITMAP)+2, &bitmap), sizeof(BITMAP)); + ok_long(bitmap.bmType, 0); + ok_long(bitmap.bmWidth, 10); + ok_long(bitmap.bmHeight, 9); + ok_long(bitmap.bmWidthBytes, 20); + ok_long(bitmap.bmPlanes, 1); + ok_long(bitmap.bmBitsPixel, 16); ok(bitmap.bmBits == pData, "\n"); - ok(GetObject(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(DIBSECTION), "\n"); - ok(GetObject(hBitmap, sizeof(DIBSECTION)+2, &dibsection) == sizeof(DIBSECTION), "\n"); - ok(GetObject(hBitmap, -5, &dibsection) == sizeof(DIBSECTION), "\n"); - ok(GetLastError() == ERROR_SUCCESS, "\n"); + ok_long(GetObject(hBitmap, sizeof(DIBSECTION), &dibsection), sizeof(DIBSECTION)); + ok_long(GetObject(hBitmap, sizeof(DIBSECTION)+2, &dibsection), sizeof(DIBSECTION)); + ok_long(GetObject(hBitmap, -5, &dibsection), sizeof(DIBSECTION)); + ok_err(ERROR_SUCCESS); DeleteObject(hBitmap); ReleaseDC(0, hDC); } @@ -333,6 +333,59 @@ ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, sizeof(LOGBRUSH), &logbrush) == 0, "\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError()); +} + +void +Test_DIBBrush(void) +{ + struct + { + BITMAPINFOHEADER bmiHeader; + WORD wColors[4]; + BYTE jBuffer[16]; + } PackedDIB = + { + {sizeof(BITMAPINFOHEADER), 4, 4, 1, 8, BI_RGB, 0, 1, 1, 4, 0}, + {1, 7, 3, 1}, + {0,1,2,3, 1,2,3,0, 2,3,0,1, 3,0,1,2}, + }; + PBITMAPINFO pbmi = (PBITMAPINFO)&PackedDIB; + LOGBRUSH logbrush; + HBRUSH hBrush; + + /* Create a DIB brush */ + hBrush = CreateDIBPatternBrushPt(&PackedDIB, DIB_PAL_COLORS); + ok(hBrush != 0, "CreateSolidBrush failed, skipping tests.\n"); + if (!hBrush) return; + + FillMemory(&logbrush, sizeof(LOGBRUSH), 0x77); + SetLastError(ERROR_SUCCESS); + + ok_long(GetObject(hBrush, sizeof(LOGBRUSH), &logbrush), sizeof(LOGBRUSH)); + ok_long(logbrush.lbStyle, BS_DIBPATTERN); + ok_long(logbrush.lbColor, 0); + ok_long(logbrush.lbHatch, (ULONG_PTR)&PackedDIB); + + ok_err(ERROR_SUCCESS); + DeleteObject(hBrush); + + + /* Create a DIB brush with undocumented iUsage 2 */ + hBrush = CreateDIBPatternBrushPt(&PackedDIB, 2); + ok(hBrush != 0, "CreateSolidBrush failed, skipping tests.\n"); + if (!hBrush) return; + + FillMemory(&logbrush, sizeof(LOGBRUSH), 0x77); + SetLastError(ERROR_SUCCESS); + + ok_long(GetObject(hBrush, sizeof(LOGBRUSH), &logbrush), sizeof(LOGBRUSH)); + ok_long(logbrush.lbStyle, BS_DIBPATTERN); + ok_long(logbrush.lbColor, 0); + ok_long(logbrush.lbHatch, (ULONG_PTR)&PackedDIB); + + ok_err(ERROR_SUCCESS); + DeleteObject(hBrush); + } void @@ -632,6 +685,7 @@ Test_Dibsection(); Test_Palette(); Test_Brush(); + Test_DIBBrush(); Test_Pen(); Test_ExtPen(); // not implemented yet in ROS Test_MetaDC(); Added: 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 (added) +++ trunk/rostests/apitests/gdi32/init.c [iso-8859-1] Fri May 4 18:56:43 2012 @@ -1,0 +1,51 @@ + +#include <stdio.h> +#include <windows.h> + +HBITMAP ghbmpDIB32; +HDC ghdcDIB32; +PULONG pulDIB32Bits; +HPALETTE ghpal; + +struct +{ + WORD palVersion; + WORD palNumEntries; + PALETTEENTRY logpalettedata[8]; +} gpal = +{ + 0x300, 8, + { + { 0x10, 0x20, 0x30, PC_NOCOLLAPSE }, + { 0x20, 0x30, 0x40, PC_NOCOLLAPSE }, + { 0x30, 0x40, 0x50, PC_NOCOLLAPSE }, + { 0x40, 0x50, 0x60, PC_NOCOLLAPSE }, + { 0x50, 0x60, 0x70, PC_NOCOLLAPSE }, + { 0x60, 0x70, 0x80, PC_NOCOLLAPSE }, + { 0x70, 0x80, 0x90, PC_NOCOLLAPSE }, + { 0x80, 0x90, 0xA0, PC_NOCOLLAPSE }, + } +}; + +BOOL InitStuff(void) +{ + BITMAPINFO bmi32 = + {{sizeof(BITMAPINFOHEADER), 4, -4, 1, 32, BI_RGB, 0, 1, 1, 0, 0}, {0}}; + + ghdcDIB32 = CreateCompatibleDC(0); + + ghbmpDIB32 = CreateDIBSection(ghdcDIB32, &bmi32, DIB_PAL_COLORS, (PVOID*)&pulDIB32Bits, 0, 0 ); + if (!ghbmpDIB32) return FALSE; + + SelectObject(ghdcDIB32, ghbmpDIB32); + + /* Initialize a logical palette */ + ghpal = CreatePalette((LOGPALETTE*)&gpal); + if (!ghpal) + { + printf("failed to create a palette \n"); + return FALSE; + } + + return TRUE; +} Propchange: trunk/rostests/apitests/gdi32/init.c ------------------------------------------------------------------------------ svn:eol-style = native Added: 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 (added) +++ trunk/rostests/apitests/gdi32/init.h [iso-8859-1] Fri May 4 18:56:43 2012 @@ -1,0 +1,13 @@ + +extern HBITMAP ghbmpDIB32; +extern HDC ghdcDIB32; +extern PULONG pulDIB32Bits; +extern HPALETTE ghpal; +extern struct +{ + LOGPALETTE logpal; + PALETTEENTRY logpalettedata[8]; +} gpal; + +BOOL InitStuff(void); + Propchange: trunk/rostests/apitests/gdi32/init.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/gdi32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/testlist.c…
============================================================================== --- trunk/rostests/apitests/gdi32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/testlist.c [iso-8859-1] Fri May 4 18:56:43 2012 @@ -14,6 +14,7 @@ extern void func_CreateBitmapIndirect(void); extern void func_CreateCompatibleDC(void); extern void func_CreateDIBitmap(void); +extern void func_CreateDIBPatternBrush(void); extern void func_CreateFont(void); extern void func_CreateFontIndirect(void); extern void func_CreateIconIndirect(void); @@ -71,6 +72,7 @@ { "CreateBitmapIndirect", func_CreateBitmapIndirect }, { "CreateCompatibleDC", func_CreateCompatibleDC }, { "CreateDIBitmap", func_CreateDIBitmap }, + { "CreateDIBPatternBrush", func_CreateDIBPatternBrush }, { "CreateFont", func_CreateFont }, { "CreateFontIndirect", func_CreateFontIndirect }, { "CreateIconIndirect", func_CreateFontIndirect },
12 years, 7 months
1
0
0
0
[tkreuzer] 56497: [WIN32K] Commit what I forgot
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 4 17:39:00 2012 New Revision: 56497 URL:
http://svn.reactos.org/svn/reactos?rev=56497&view=rev
Log: [WIN32K] Commit what I forgot Modified: trunk/reactos/win32ss/user/ntuser/clipboard.c trunk/reactos/win32ss/user/ntuser/misc/file.c Modified: trunk/reactos/win32ss/user/ntuser/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/clipbo…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/clipboard.c [iso-8859-1] Fri May 4 17:39:00 2012 @@ -225,6 +225,7 @@ pConvertedBmi, DIB_RGB_COLORS, 0, + pMemObj->cbData - Offset, 0); if (hBm) Modified: trunk/reactos/win32ss/user/ntuser/misc/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/misc/f…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/misc/file.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/misc/file.c [iso-8859-1] Fri May 4 17:39:00 2012 @@ -229,6 +229,7 @@ pConvertedInfo, DIB_RGB_COLORS, 0, + pbmfh->bfSize - pbmfh->bfOffBits, 0); NtGdiDeleteObjectApp(hdc);
12 years, 7 months
1
0
0
0
[tkreuzer] 56496: [WIN32K] - Add cjMaxBits parameter to GreCreateDIBitmapInternal - Rename GDIBRUSH_* constants to BR_*, as they are named in gdikdx
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 4 17:37:07 2012 New Revision: 56496 URL:
http://svn.reactos.org/svn/reactos?rev=56496&view=rev
Log: [WIN32K] - Add cjMaxBits parameter to GreCreateDIBitmapInternal - Rename GDIBRUSH_* constants to BR_*, as they are named in gdikdx Modified: trunk/reactos/win32ss/gdi/eng/engbrush.c trunk/reactos/win32ss/gdi/eng/lineto.c trunk/reactos/win32ss/gdi/ntgdi/bitblt.c trunk/reactos/win32ss/gdi/ntgdi/bitmaps.h trunk/reactos/win32ss/gdi/ntgdi/brush.c trunk/reactos/win32ss/gdi/ntgdi/brush.h trunk/reactos/win32ss/gdi/ntgdi/dibobj.c trunk/reactos/win32ss/gdi/ntgdi/drawing.c trunk/reactos/win32ss/gdi/ntgdi/fillshap.c trunk/reactos/win32ss/gdi/ntgdi/line.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] Fri May 4 17:37:07 2012 @@ -40,12 +40,12 @@ GDIOBJ_vReferenceObjectByPointer(&pebo->ppalSurf->BaseObject); //pebo->ppalDC = pdc->dclevel.ppal; - if (pbrush->flAttrs & GDIBRUSH_IS_NULL) + if (pbrush->flAttrs & BR_IS_NULL) { /* NULL brushes don't need a color */ pebo->BrushObject.iSolidColor = 0; } - else if (pbrush->flAttrs & GDIBRUSH_IS_SOLID) + else if (pbrush->flAttrs & BR_IS_SOLID) { /* Set the RGB color */ EBRUSHOBJ_vSetSolidRGBColor(pebo, pbrush->BrushAttr.lbColor); @@ -56,7 +56,7 @@ pebo->BrushObject.iSolidColor = 0xFFFFFFFF; /* Use foreground color of hatch brushes */ - if (pbrush->flAttrs & GDIBRUSH_IS_HATCH) + if (pbrush->flAttrs & BR_IS_HATCH) pebo->crCurrentText = pbrush->BrushAttr.lbColor; } } @@ -69,7 +69,7 @@ EXLATEOBJ exlo; /* Never use with non-solid brushes */ - ASSERT(pebo->flattrs & GDIBRUSH_IS_SOLID); + ASSERT(pebo->flattrs & BR_IS_SOLID); /* Set the RGB color */ pebo->crRealize = crColor; @@ -217,7 +217,7 @@ psurfMask = NULL; /* DIB brushes with DIB_PAL_COLORS usage need a new palette */ - if (pebo->pbrush->flAttrs & GDIBRUSH_IS_DIBPALCOLORS) + if (pebo->pbrush->flAttrs & BR_IS_DIBPALCOLORS) { ASSERT(FALSE); ppalPattern = 0; //CreateDIBPalette(psurfPattern->ppal, pebo->ppalDC); Modified: trunk/reactos/win32ss/gdi/eng/lineto.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/lineto.c?r…
============================================================================== --- trunk/reactos/win32ss/gdi/eng/lineto.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/lineto.c [iso-8859-1] Fri May 4 17:37:07 2012 @@ -519,7 +519,7 @@ ASSERT(GdiBrush); ASSERT(GdiBrush->pbrush); - if (GdiBrush->pbrush->flAttrs & GDIBRUSH_IS_NULL) + if (GdiBrush->pbrush->flAttrs & BR_IS_NULL) return TRUE; /* No success yet */ 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] Fri May 4 17:37:07 2012 @@ -831,7 +831,7 @@ FIXUP_ROP(dwRop); - if (pbrush->flAttrs & GDIBRUSH_IS_NULL) + if (pbrush->flAttrs & BR_IS_NULL) { return TRUE; } Modified: trunk/reactos/win32ss/gdi/ntgdi/bitmaps.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitmaps.…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/bitmaps.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/bitmaps.h [iso-8859-1] Fri May 4 17:37:07 2012 @@ -25,7 +25,7 @@ _In_ FLONG flags); HBITMAP -FASTCALL +NTAPI GreCreateDIBitmapInternal( IN HDC hDc, IN INT cx, @@ -35,4 +35,5 @@ IN OPTIONAL PBITMAPINFO pbmi, IN DWORD iUsage, IN FLONG fl, + IN UINT cjMaxBits, IN HANDLE hcmXform); 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] Fri May 4 17:37:07 2012 @@ -40,7 +40,7 @@ IntGdiSetBrushOwner(PBRUSH pbr, ULONG ulOwner) { // FIXME: - if (pbr->flAttrs & GDIBRUSH_IS_GLOBAL) return TRUE; + if (pbr->flAttrs & BR_IS_GLOBAL) return TRUE; if ((ulOwner == GDI_OBJ_HMGR_PUBLIC) || ulOwner == GDI_OBJ_HMGR_NONE) { @@ -129,7 +129,7 @@ BRUSH_Cleanup(PVOID ObjectBody) { PBRUSH pbrush = (PBRUSH)ObjectBody; - if (pbrush->flAttrs & (GDIBRUSH_IS_HATCH | GDIBRUSH_IS_BITMAP)) + if (pbrush->flAttrs & (BR_IS_HATCH | BR_IS_BITMAP)) { ASSERT(pbrush->hbmPattern); GreSetObjectOwner(pbrush->hbmPattern, GDI_OBJ_HMGR_POWNED); @@ -162,7 +162,7 @@ Buffer->lbColor = pbrush->BrushAttr.lbColor; /* Set Hatch */ - if ((pbrush->flAttrs & GDIBRUSH_IS_HATCH)!=0) + if ((pbrush->flAttrs & BR_IS_HATCH)!=0) { /* FIXME: This is not the right value */ Buffer->lbHatch = (LONG)pbrush->hbmPattern; @@ -175,23 +175,23 @@ Buffer->lbStyle = 0; /* Get the type of style */ - if ((pbrush->flAttrs & GDIBRUSH_IS_SOLID)!=0) + if ((pbrush->flAttrs & BR_IS_SOLID)!=0) { Buffer->lbStyle = BS_SOLID; } - else if ((pbrush->flAttrs & GDIBRUSH_IS_NULL)!=0) + else if ((pbrush->flAttrs & BR_IS_NULL)!=0) { Buffer->lbStyle = BS_NULL; // BS_HOLLOW } - else if ((pbrush->flAttrs & GDIBRUSH_IS_HATCH)!=0) + else if ((pbrush->flAttrs & BR_IS_HATCH)!=0) { Buffer->lbStyle = BS_HATCHED; } - else if ((pbrush->flAttrs & GDIBRUSH_IS_BITMAP)!=0) + else if ((pbrush->flAttrs & BR_IS_BITMAP)!=0) { Buffer->lbStyle = BS_PATTERN; } - else if ((pbrush->flAttrs & GDIBRUSH_IS_DIB)!=0) + else if ((pbrush->flAttrs & BR_IS_DIB)!=0) { Buffer->lbStyle = BS_DIBPATTERN; } @@ -254,7 +254,7 @@ } hBrush = pbrush->BaseObject.hHmgr; - pbrush->flAttrs |= GDIBRUSH_IS_BITMAP | GDIBRUSH_IS_DIB; + pbrush->flAttrs |= BR_IS_BITMAP | BR_IS_DIB; pbrush->hbmPattern = hPattern; /* FIXME: Fill in the rest of fields!!! */ @@ -296,7 +296,7 @@ } hBrush = pbrush->BaseObject.hHmgr; - pbrush->flAttrs |= GDIBRUSH_IS_HATCH; + pbrush->flAttrs |= BR_IS_HATCH; pbrush->hbmPattern = hPattern; pbrush->BrushAttr.lbColor = Color & 0xFFFFFF; @@ -332,7 +332,7 @@ } hBrush = pbrush->BaseObject.hHmgr; - pbrush->flAttrs |= GDIBRUSH_IS_BITMAP; + pbrush->flAttrs |= BR_IS_BITMAP; pbrush->hbmPattern = hPattern; /* FIXME: Fill in the rest of fields!!! */ @@ -359,7 +359,7 @@ } hBrush = pbrush->BaseObject.hHmgr; - pbrush->flAttrs |= GDIBRUSH_IS_SOLID; + pbrush->flAttrs |= BR_IS_SOLID; pbrush->BrushAttr.lbColor = Color & 0x00FFFFFF; /* FIXME: Fill in the rest of fields!!! */ @@ -384,7 +384,7 @@ } hBrush = pbrush->BaseObject.hHmgr; - pbrush->flAttrs |= GDIBRUSH_IS_NULL; + pbrush->flAttrs |= BR_IS_NULL; GDIOBJ_vUnlockObject(&pbrush->BaseObject); return hBrush; @@ -397,7 +397,7 @@ PBRUSH pbrush; pbrush = BRUSH_ShareLockBrush(hBrush); - if (pbrush->flAttrs & GDIBRUSH_IS_SOLID) + if (pbrush->flAttrs & BR_IS_SOLID) { pbrush->BrushAttr.lbColor = Color & 0xFFFFFF; } 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] Fri May 4 17:37:07 2012 @@ -19,7 +19,7 @@ ULONG ulStyle; HBITMAP hbmPattern; - HANDLE hbmClient; + HBITMAP hbmClient; ULONG flAttrs; ULONG ulBrushUnique; @@ -67,24 +67,24 @@ } EBRUSHOBJ, *PEBRUSHOBJ; /* GDI Brush Attributes */ -#define GDIBRUSH_NEED_FG_CLR 0x0001 -#define GDIBRUSH_NEED_BK_CLR 0x0002 /* Background color is needed */ -#define GDIBRUSH_DITHER_OK 0x0004 /* Allow color dithering */ -#define GDIBRUSH_IS_SOLID 0x0010 /* Solid brush */ -#define GDIBRUSH_IS_HATCH 0x0020 /* Hatch brush */ -#define GDIBRUSH_IS_BITMAP 0x0040 /* DDB pattern brush */ -#define GDIBRUSH_IS_DIB 0x0080 /* DIB pattern brush */ -#define GDIBRUSH_IS_NULL 0x0100 /* Null/hollow brush */ -#define GDIBRUSH_IS_GLOBAL 0x0200 /* Stock objects */ -#define GDIBRUSH_IS_PEN 0x0400 /* Pen */ -#define GDIBRUSH_IS_OLDSTYLEPEN 0x0800 /* Geometric pen */ -#define GDIBRUSH_IS_DIBPALCOLORS 0x1000 -#define GDIBRUSH_IS_DIBPALINDICE 0x2000 -#define GDIBRUSH_IS_DEFAULTSTYLE 0x4000 -#define GDIBRUSH_IS_MASKING 0x8000 /* Pattern bitmap is used as transparent mask (?) */ -#define GDIBRUSH_IS_INSIDEFRAME 0x00010000 -#define GDIBRUSH_CACHED_ENGINE 0x00040000 -#define GDIBRUSH_CACHED_IS_SOLID 0x80000000 +#define BR_NEED_FG_CLR 0x00000001 +#define BR_NEED_BK_CLR 0x00000002 /* Background color is needed */ +#define BR_DITHER_OK 0x00000004 /* Allow color dithering */ +#define BR_IS_SOLID 0x00000010 /* Solid brush */ +#define BR_IS_HATCH 0x00000020 /* Hatch brush */ +#define BR_IS_BITMAP 0x00000040 /* DDB pattern brush */ +#define BR_IS_DIB 0x00000080 /* DIB pattern brush */ +#define BR_IS_NULL 0x00000100 /* Null/hollow brush */ +#define BR_IS_GLOBAL 0x00000200 /* Stock objects */ +#define BR_IS_PEN 0x00000400 /* Pen */ +#define BR_IS_OLDSTYLEPEN 0x00000800 /* Geometric pen */ +#define BR_IS_DIBPALCOLORS 0x00001000 +#define BR_IS_DIBPALINDICE 0x00002000 +#define BR_IS_DEFAULTSTYLE 0x00004000 +#define BR_IS_MASKING 0x00008000 /* Pattern bitmap is used as transparent mask (?) */ +#define BR_IS_INSIDEFRAME 0x00010000 +#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))) Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dibobj.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Fri May 4 17:37:07 2012 @@ -1294,6 +1294,7 @@ pbmi, iUsage, fl, + cjMaxBits, hcmXform); cleanup: @@ -1302,7 +1303,7 @@ } HBITMAP -FASTCALL +NTAPI GreCreateDIBitmapInternal( IN HDC hDc, IN INT cx, @@ -1312,6 +1313,7 @@ IN OPTIONAL PBITMAPINFO pbmi, IN DWORD iUsage, IN FLONG fl, + IN UINT cjMaxBits, IN HANDLE hcmXform) { PDC Dc; 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] Fri May 4 17:37:07 2012 @@ -1263,7 +1263,7 @@ return 0; } - if (!(pbrush->flAttrs & GDIBRUSH_IS_NULL)) + if (!(pbrush->flAttrs & BR_IS_NULL)) { pdcattr = dc->pdcattr; 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] Fri May 4 17:37:07 2012 @@ -85,7 +85,7 @@ ASSERT(psurf); /* Now fill the polygon with the current fill brush. */ - if (!(pbrFill->flAttrs & GDIBRUSH_IS_NULL)) + if (!(pbrFill->flAttrs & BR_IS_NULL)) { BrushOrigin = *((PPOINTL)&pbrFill->ptOrigin); BrushOrigin.x += dc->ptlDCOrig.x; @@ -100,7 +100,7 @@ } // Draw the Polygon Edges with the current pen ( if not a NULL pen ) - if (!(pbrLine->flAttrs & GDIBRUSH_IS_NULL)) + if (!(pbrLine->flAttrs & BR_IS_NULL)) { int i; @@ -574,7 +574,7 @@ if (pbrFill) { - if (!(pbrFill->flAttrs & GDIBRUSH_IS_NULL)) + if (!(pbrFill->flAttrs & BR_IS_NULL)) { BrushOrigin = *((PPOINTL)&pbrFill->ptOrigin); BrushOrigin.x += dc->ptlDCOrig.x; @@ -597,7 +597,7 @@ ret = TRUE; // Change default to success - if (!(pbrLine->flAttrs & GDIBRUSH_IS_NULL)) + if (!(pbrLine->flAttrs & BR_IS_NULL)) { Mix = ROP2_TO_MIX(pdcattr->jROP2); ret = ret && IntEngLineTo(&psurf->SurfObj, Modified: trunk/reactos/win32ss/gdi/ntgdi/line.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/line.c?r…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/line.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/line.c [iso-8859-1] Fri May 4 17:37:07 2012 @@ -131,7 +131,7 @@ pbrLine = dc->dclevel.pbrLine; ASSERT(pbrLine); - if (!(pbrLine->flAttrs & GDIBRUSH_IS_NULL)) + if (!(pbrLine->flAttrs & BR_IS_NULL)) { Ret = IntEngLineTo(&psurf->SurfObj, dc->rosdc.CombinedClip, @@ -249,7 +249,7 @@ pbrLine = dc->dclevel.pbrLine; ASSERT(pbrLine); - if (!(pbrLine->flAttrs & GDIBRUSH_IS_NULL)) + if (!(pbrLine->flAttrs & BR_IS_NULL)) { Points = EngAllocMem(0, Count * sizeof(POINT), GDITAG_TEMP); if (Points != NULL) 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] Fri May 4 17:37:07 2012 @@ -86,7 +86,7 @@ pbrushPen->dwStyleCount = dwStyleCount; pbrushPen->pStyle = pStyle; - pbrushPen->flAttrs = bOldStylePen? GDIBRUSH_IS_OLDSTYLEPEN : GDIBRUSH_IS_PEN; + pbrushPen->flAttrs = bOldStylePen? BR_IS_OLDSTYLEPEN : BR_IS_PEN; // If dwPenStyle is PS_COSMETIC, the width must be set to 1. if ( !(bOldStylePen) && ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) && ( dwWidth != 1) ) @@ -95,40 +95,40 @@ switch (dwPenStyle & PS_STYLE_MASK) { case PS_NULL: - pbrushPen->flAttrs |= GDIBRUSH_IS_NULL; + pbrushPen->flAttrs |= BR_IS_NULL; break; case PS_SOLID: - pbrushPen->flAttrs |= GDIBRUSH_IS_SOLID; + pbrushPen->flAttrs |= BR_IS_SOLID; break; case PS_ALTERNATE: - pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP; + pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternAlternate); break; case PS_DOT: - pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP; + pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDot); break; case PS_DASH: - pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP; + pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDash); break; case PS_DASHDOT: - pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP; + pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDot); break; case PS_DASHDOTDOT: - pbrushPen->flAttrs |= GDIBRUSH_IS_BITMAP; + pbrushPen->flAttrs |= BR_IS_BITMAP; pbrushPen->hbmPattern = GreCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternDashDotDot); break; case PS_INSIDEFRAME: - pbrushPen->flAttrs |= (GDIBRUSH_IS_SOLID|GDIBRUSH_IS_INSIDEFRAME); + pbrushPen->flAttrs |= (BR_IS_SOLID|BR_IS_INSIDEFRAME); break; case PS_USERSTYLE: @@ -136,7 +136,7 @@ { /* FIXME: PS_USERSTYLE workaround */ DPRINT1("PS_COSMETIC | PS_USERSTYLE not handled\n"); - pbrushPen->flAttrs |= GDIBRUSH_IS_SOLID; + pbrushPen->flAttrs |= BR_IS_SOLID; break; } else @@ -180,7 +180,7 @@ pbrPen = PEN_ShareLockPen(hPen); if (pbrPen) { - if (pbrPen->flAttrs & GDIBRUSH_IS_SOLID) + if (pbrPen->flAttrs & BR_IS_SOLID) { pbrPen->BrushAttr.lbColor = Color & 0xFFFFFF; } @@ -195,7 +195,7 @@ PEXTLOGPEN pExtLogPen; INT cbRetCount; - if (pbrushPen->flAttrs & GDIBRUSH_IS_OLDSTYLEPEN) + if (pbrushPen->flAttrs & BR_IS_OLDSTYLEPEN) { cbRetCount = sizeof(LOGPEN); if (pBuffer) 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] Fri May 4 17:37:07 2012 @@ -120,16 +120,16 @@ pbrushPen->hbmClient = (HANDLE)NULL; pbrushPen->dwStyleCount = 0; pbrushPen->pStyle = 0; - pbrushPen->flAttrs = GDIBRUSH_IS_OLDSTYLEPEN; + pbrushPen->flAttrs = BR_IS_OLDSTYLEPEN; switch (dwPenStyle & PS_STYLE_MASK) { case PS_NULL: - pbrushPen->flAttrs |= GDIBRUSH_IS_NULL; + pbrushPen->flAttrs |= BR_IS_NULL; break; case PS_SOLID: - pbrushPen->flAttrs |= GDIBRUSH_IS_SOLID; + pbrushPen->flAttrs |= BR_IS_SOLID; break; } hPen = pbrushPen->BaseObject.hHmgr;
12 years, 7 months
1
0
0
0
[tkreuzer] 56495: [GDI32_APITEST] - Comment out a broken test (works only on 32bpp) - Fix MSVC warning
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 4 12:32:11 2012 New Revision: 56495 URL:
http://svn.reactos.org/svn/reactos?rev=56495&view=rev
Log: [GDI32_APITEST] - Comment out a broken test (works only on 32bpp) - Fix MSVC warning Modified: trunk/rostests/apitests/gdi32/SetDCPenColor.c trunk/rostests/apitests/gdi32/SetPixel.c Modified: trunk/rostests/apitests/gdi32/SetDCPenColor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/SetDCPenCo…
============================================================================== --- trunk/rostests/apitests/gdi32/SetDCPenColor.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/SetDCPenColor.c [iso-8859-1] Fri May 4 12:32:11 2012 @@ -12,7 +12,7 @@ void Test_SetDCPenColor() { HDC hScreenDC, hDC; - HBITMAP hbmp; + HBITMAP hbmp, hbmpOld; // Test an incorrect DC SetLastError(ERROR_SUCCESS); @@ -49,13 +49,15 @@ hbmp = CreateBitmap(10, 10, 1, 32, NULL); ok(hbmp != 0, "CreateBitmap failed, skipping tests\n"); if (!hbmp) return; - - SelectObject(hDC, hbmp); + hbmpOld = SelectObject(hDC, hbmp); +#if 0 // this only works on 32 bpp screen resolution + ok(hbmpOld != NULL, "\n"); SelectObject(hDC, GetStockObject(DC_PEN)); SetDCPenColor(hDC, 0x123456); MoveToEx(hDC, 0, 0, NULL); LineTo(hDC, 10, 0); ok(GetPixel(hDC, 5, 0) == 0x123456, "\n"); +#endif // Delete the DC DeleteDC(hDC); Modified: trunk/rostests/apitests/gdi32/SetPixel.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/SetPixel.c…
============================================================================== --- trunk/rostests/apitests/gdi32/SetPixel.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/SetPixel.c [iso-8859-1] Fri May 4 12:32:11 2012 @@ -71,7 +71,7 @@ HDC hdc; HPALETTE hpal, hpalOld; PULONG pulBits; - ULONG i; + USHORT i; /* Initialize the BITMAPINFO */ pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
12 years, 7 months
1
0
0
0
[tfaber] 56494: [KERNEL32_APITEST] - Add a test checking that GetModuleFileName returns a full path See issue #6786 for more details.
by tfaber@svn.reactos.org
Author: tfaber Date: Fri May 4 12:31:47 2012 New Revision: 56494 URL:
http://svn.reactos.org/svn/reactos?rev=56494&view=rev
Log: [KERNEL32_APITEST] - Add a test checking that GetModuleFileName returns a full path See issue #6786 for more details. Added: trunk/rostests/apitests/kernel32/GetModuleFileName.c (with props) Modified: trunk/rostests/apitests/kernel32/CMakeLists.txt trunk/rostests/apitests/kernel32/testlist.c Modified: trunk/rostests/apitests/kernel32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/CMakeLi…
============================================================================== --- trunk/rostests/apitests/kernel32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/kernel32/CMakeLists.txt [iso-8859-1] Fri May 4 12:31:47 2012 @@ -4,11 +4,12 @@ list(APPEND SOURCE GetCurrentDirectory.c GetDriveType.c + GetModuleFileName.c SetCurrentDirectory.c testlist.c) add_executable(kernel32_apitest ${SOURCE}) target_link_libraries(kernel32_apitest wine ${PSEH_LIB}) set_module_type(kernel32_apitest win32cui) -add_importlibs(kernel32_apitest gdi32 user32 msvcrt kernel32 ntdll) +add_importlibs(kernel32_apitest gdi32 user32 shlwapi msvcrt kernel32 ntdll) add_cd_file(TARGET kernel32_apitest DESTINATION reactos/bin FOR all) Added: trunk/rostests/apitests/kernel32/GetModuleFileName.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/GetModu…
============================================================================== --- trunk/rostests/apitests/kernel32/GetModuleFileName.c (added) +++ trunk/rostests/apitests/kernel32/GetModuleFileName.c [iso-8859-1] Fri May 4 12:31:47 2012 @@ -1,0 +1,129 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Test for GetModuleFileName + * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de> + */ + +#define WIN32_NO_STATUS +#define UNICODE +#include <stdio.h> +#include <wine/test.h> +#include <windows.h> +#include <shlwapi.h> + +static +VOID +StartChild(char **argv) +{ + BOOL Success; + WCHAR Path[MAX_PATH]; + PWSTR FileName; + PWSTR Slash; + WCHAR CommandLine[MAX_PATH]; + STARTUPINFO StartupInfo; + PROCESS_INFORMATION ProcessInfo; + DWORD Ret; + int Length; + + Length = MultiByteToWideChar(CP_ACP, + 0, + argv[0], + -1, + Path, + sizeof(Path) / sizeof(WCHAR)); + + FileName = wcsrchr(Path, '\\'); + Slash = wcsrchr(Path, L'/'); + if (Slash && (!FileName || Slash > FileName)) + FileName = Slash; + + if (FileName) + { + /* It's an absolute path. Set it as current dir and get the file name */ + FileName++; + FileName[-1] = L'\0'; + + Success = SetCurrentDirectory(Path); + ok(Success == TRUE, "SetCurrentDirectory failed for path '%ls'\n", Path); + + trace("Starting '%ls' in path '%ls'\n", FileName, Path); + } + else + { + FileName = Path; + trace("Starting '%ls', which is already relative\n", FileName); + } + + swprintf(CommandLine, L"\"%ls\" GetModuleFileName relative", FileName); + + RtlZeroMemory(&StartupInfo, sizeof(StartupInfo)); + StartupInfo.cb = sizeof(StartupInfo); + + Success = CreateProcess(FileName, + CommandLine, + NULL, + NULL, + FALSE, + 0, + NULL, + NULL, + &StartupInfo, + &ProcessInfo); + if (!Success) + { + skip("CreateProcess failed with %lu\n", GetLastError()); + return; + } + CloseHandle(ProcessInfo.hThread); + Ret = WaitForSingleObject(ProcessInfo.hProcess, 30 * 1000); + ok(Ret == WAIT_OBJECT_0, "WaitForSingleObject returns %lu\n", Ret); + CloseHandle(ProcessInfo.hProcess); +} + +static +VOID +TestGetModuleFileNameA(VOID) +{ + CHAR Buffer[MAX_PATH]; + DWORD Length; + BOOL Relative; + + Length = GetModuleFileNameA(NULL, Buffer, sizeof(Buffer)); + ok(Length != 0, "Length = %lu\n", Length); + ok(Length < sizeof(Buffer), "Length = %lu\n", Length); + ok(Buffer[Length] == 0, "Buffer not null terminated\n"); + Relative = PathIsRelativeA(Buffer); + ok(Relative == FALSE, "GetModuleFileNameA returned relative path: %s\n", Buffer); +} + +static +VOID +TestGetModuleFileNameW(VOID) +{ + WCHAR Buffer[MAX_PATH]; + DWORD Length; + BOOL Relative; + + Length = GetModuleFileNameW(NULL, Buffer, sizeof(Buffer) / sizeof(WCHAR)); + ok(Length != 0, "Length = %lu\n", Length); + ok(Length < sizeof(Buffer) / sizeof(WCHAR), "Length = %lu\n", Length); + ok(Buffer[Length] == 0, "Buffer not null terminated\n"); + Relative = PathIsRelativeW(Buffer); + ok(Relative == FALSE, "GetModuleFileNameA returned relative path: %ls\n", Buffer); +} + +START_TEST(GetModuleFileName) +{ + int argc; + char **argv; + + argc = winetest_get_mainargs(&argv); + if (argc < 3) + StartChild(argv); + else + { + TestGetModuleFileNameA(); + TestGetModuleFileNameW(); + } +} Propchange: trunk/rostests/apitests/kernel32/GetModuleFileName.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/kernel32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/testlis…
============================================================================== --- trunk/rostests/apitests/kernel32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/kernel32/testlist.c [iso-8859-1] Fri May 4 12:31:47 2012 @@ -7,12 +7,14 @@ extern void func_GetCurrentDirectory(void); extern void func_GetDriveType(void); +extern void func_GetModuleFileName(void); extern void func_SetCurrentDirectory(void); const struct test winetest_testlist[] = { { "GetCurrentDirectory", func_GetCurrentDirectory }, { "GetDriveType", func_GetDriveType }, + { "GetModuleFileName", func_GetModuleFileName }, { "SetCurrentDirectory", func_SetCurrentDirectory }, { 0, 0 }
12 years, 7 months
1
0
0
0
[tkreuzer] 56493: [GDI32_APITEST] Fix gcc build
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 4 12:10:15 2012 New Revision: 56493 URL:
http://svn.reactos.org/svn/reactos?rev=56493&view=rev
Log: [GDI32_APITEST] Fix gcc build Modified: trunk/rostests/apitests/gdi32/SetBrushOrgEx.c Modified: trunk/rostests/apitests/gdi32/SetBrushOrgEx.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/SetBrushOr…
============================================================================== --- trunk/rostests/apitests/gdi32/SetBrushOrgEx.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/SetBrushOrgEx.c [iso-8859-1] Fri May 4 12:10:15 2012 @@ -25,7 +25,7 @@ } _SEH2_END; - ok(bResult == bExp, "line %ld: Wrong result, expected %ld, got %ld\n", + ok(bResult == bExp, "line %ld: Wrong result, expected %d, got %d\n", ulLine, bExp, bResult); ok(GetLastError() == dwErrExp,"line %ld: Wrong error, expected %lx, got %lx\n", ulLine, dwErrExp, GetLastError());
12 years, 7 months
1
0
0
0
[tkreuzer] 56492: [GDI32_APITEST] - Add tests for GetDIBColorTable and SetPixel, - Add more tests for CreateBitmap, GetPixel, PatBlt
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri May 4 11:40:36 2012 New Revision: 56492 URL:
http://svn.reactos.org/svn/reactos?rev=56492&view=rev
Log: [GDI32_APITEST] - Add tests for GetDIBColorTable and SetPixel, - Add more tests for CreateBitmap, GetPixel, PatBlt Added: trunk/rostests/apitests/gdi32/GetDIBColorTable.c (with props) trunk/rostests/apitests/gdi32/SetPixel.c (with props) Modified: trunk/rostests/apitests/gdi32/CMakeLists.txt trunk/rostests/apitests/gdi32/CreateBitmap.c trunk/rostests/apitests/gdi32/GetPixel.c trunk/rostests/apitests/gdi32/PatBlt.c trunk/rostests/apitests/gdi32/testlist.c Modified: trunk/rostests/apitests/gdi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CMakeLists…
============================================================================== --- trunk/rostests/apitests/gdi32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/CMakeLists.txt [iso-8859-1] Fri May 4 11:40:36 2012 @@ -37,6 +37,7 @@ GdiSetAttrs.c GetClipRgn.c GetCurrentObject.c + GetDIBColorTable.c GetDIBits.c GetObject.c GetRandomRgn.c @@ -48,9 +49,11 @@ PatBlt.c Rectangle.c SelectObject.c + SetBrushOrgEx.c SetDCPenColor.c SetDIBits.c SetMapMode.c + SetPixel.c SetSysColors.c SetWindowExtEx.c SetWorldTransform.c Modified: trunk/rostests/apitests/gdi32/CreateBitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CreateBitm…
============================================================================== --- trunk/rostests/apitests/gdi32/CreateBitmap.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/CreateBitmap.c [iso-8859-1] Fri May 4 11:40:36 2012 @@ -11,6 +11,85 @@ #define DEFAULT_BITMAP 21 +void Test_CreateBitmap_Params() +{ + HBITMAP hbmp; + + /* All of these should get us the default bitmap */ + hbmp = CreateBitmap(0, 0, 0, 0, NULL); + ok(hbmp == GetStockObject(21), "should get the default bitmap\n"); + hbmp = CreateBitmap(1, 0, 0, 0, NULL); + ok(hbmp == GetStockObject(21), "should get the default bitmap\n"); + hbmp = CreateBitmap(0, 1, 0, 0, NULL); + ok(hbmp == GetStockObject(21), "should get the default bitmap\n"); + hbmp = CreateBitmap(0, 1, 1, 0, NULL); + ok(hbmp == GetStockObject(21), "should get the default bitmap\n"); + hbmp = CreateBitmap(0, 1, 63, 33, NULL); + ok(hbmp == GetStockObject(21), "should get the default bitmap\n"); + hbmp = CreateBitmap(0, -4, -32, 233, NULL); + ok(hbmp == GetStockObject(21), "should get the default bitmap\n"); + + SetLastError(0); + hbmp = CreateBitmap(1, -1, 1, 0, NULL); + ok(hbmp == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + SetLastError(0); + hbmp = CreateBitmap(-1, 1, 1, 0, NULL); + ok(hbmp == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + SetLastError(0); + hbmp = CreateBitmap(-1, 1, 1, 1, NULL); + ok(hbmp == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + SetLastError(0); + hbmp = CreateBitmap(1, -1, 1, 1, NULL); + ok(hbmp == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + /* Check if an overflow in cPlanes * cBitsPixel is handled */ + SetLastError(0); + hbmp = CreateBitmap(1, 1, 2, 0x80000004, NULL); + ok(hbmp == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + /* Check for maximum width */ + hbmp = CreateBitmap(0x7FFFFFF, 1, 1, 1, NULL); + ok(hbmp != 0, "\n"); + DeleteObject(hbmp); + SetLastError(0); + hbmp = CreateBitmap(0x8000000, 1, 1, 1, NULL); + ok(hbmp == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + + /* Check for maximum height */ + hbmp = CreateBitmap(1, 0x1FFFFF00, 1, 1, NULL); + ok(hbmp != 0, "\n"); + DeleteObject(hbmp); + SetLastError(0); + hbmp = CreateBitmap(1, 0x1FFFFFFF, 1, 1, NULL); + ok(hbmp == 0, "\n"); + ok_err(0); + + /* Check for overflow in width * height */ + hbmp = CreateBitmap(0x20000, 0x1FFFF, 1, 1, NULL); + ok(hbmp != 0, "\n"); + DeleteObject(hbmp); + SetLastError(0); + hbmp = CreateBitmap(0x20000, 0x20000, 1, 1, NULL); + ok(hbmp == 0, "\n"); + ok_err(0); + + /* Check huge allocation */ + SetLastError(0); + hbmp = CreateBitmap(0x2000, 0x20000, 32, 1, NULL); + ok(hbmp == 0, "\n"); + ok_err(ERROR_INVALID_PARAMETER); + +} + void Test_CreateBitmap() { HBITMAP hbmp; @@ -20,10 +99,8 @@ hbmp = CreateBitmap(0, 0, 0, 0, NULL); ok(hbmp != 0, "should get a 1x1 bitmap\n"); ok(hbmp == GetStockObject(DEFAULT_BITMAP), "\n"); - result = GetObject(hbmp, sizeof(bitmap), &bitmap); ok(result > 0, "result = %d\n", result); - ok(bitmap.bmType == 0, "bmType = %ld\n", bitmap.bmType); ok(bitmap.bmWidth == 1, "bmWidth = %ld\n", bitmap.bmWidth); ok(bitmap.bmHeight == 1, "bmHeight = %ld\n", bitmap.bmHeight); @@ -31,19 +108,27 @@ ok(bitmap.bmPlanes == 1, "bmPlanes = %d\n", bitmap.bmPlanes); ok(bitmap.bmBitsPixel == 1, "bmBitsPixel = %d\n", bitmap.bmBitsPixel); ok(bitmap.bmBits == 0, "bmBits = %p\n", bitmap.bmBits); - DeleteObject(hbmp); - hbmp = CreateBitmap(1, -1, 1, 0, NULL); - ok(hbmp == 0, "\n"); + hbmp = CreateBitmap(1, 2, 1, 1, NULL); + ok(hbmp != 0, "should get a 1x2 bitmap\n"); + result = GetObject(hbmp, sizeof(bitmap), &bitmap); + ok(result > 0, "result = %d\n", result); + ok(bitmap.bmType == 0, "bmType = %ld\n", bitmap.bmType); + ok(bitmap.bmWidth == 1, "bmWidth = %ld\n", bitmap.bmWidth); + ok(bitmap.bmHeight == 2, "bmHeight = %ld\n", bitmap.bmHeight); + ok(bitmap.bmWidthBytes == 2, "bmWidthBytes = %ld\n", bitmap.bmWidthBytes); + ok(bitmap.bmPlanes == 1, "bmPlanes = %d\n", bitmap.bmPlanes); + ok(bitmap.bmBitsPixel == 1, "bmBitsPixel = %d\n", bitmap.bmBitsPixel); + ok(bitmap.bmBits == 0, "bmBits = %p\n", bitmap.bmBits); + DeleteObject(hbmp); - hbmp = CreateBitmap(-1, 1, 1, 0, NULL); - ok(hbmp == 0, "\n"); } START_TEST(CreateBitmap) { + Test_CreateBitmap_Params(); Test_CreateBitmap(); } Added: trunk/rostests/apitests/gdi32/GetDIBColorTable.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetDIBColo…
============================================================================== --- trunk/rostests/apitests/gdi32/GetDIBColorTable.c (added) +++ trunk/rostests/apitests/gdi32/GetDIBColorTable.c [iso-8859-1] Fri May 4 11:40:36 2012 @@ -1,0 +1,105 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for ... + * PROGRAMMERS: Timo Kreuzer + */ + +#include <stdio.h> +#include <wine/test.h> +#include <windows.h> + +void Test_GetDIBColorTable() +{ + struct + { + BITMAPINFOHEADER bmiHeader; + ULONG bmiColors[8]; + } bmibuffer; + BITMAPINFO *pbmi = (PVOID)&bmibuffer; + HBITMAP hbmp, hbmpOld; + HDC hdc; + PBYTE pjBits; + UINT cColors; + ULONG aulColors[257]; + + hdc = CreateCompatibleDC(0); + ok(hdc != 0, "failed\n"); + + SetLastError(0); + cColors = GetDIBColorTable(hdc, 0, 257, (RGBQUAD*)aulColors); + ok_long(cColors, 2); + ok_err(0); + + hbmp = CreateBitmap(1, 1, 1, 1, NULL); + ok(hbmp != 0, "\n"); + hbmpOld = SelectObject(hdc, hbmp); + ok(hbmpOld != 0, "Failed to select bitmap\n"); + cColors = GetDIBColorTable(hdc, 0, 257, (RGBQUAD*)aulColors); + ok_long(cColors, 2); + ok_err(0); + SelectObject(hdc, hbmpOld); + DeleteObject(hbmp); + + /* Initialize a BITMAPINFO */ + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = 2; + pbmi->bmiHeader.biHeight = 2; + pbmi->bmiHeader.biPlanes = 1; + pbmi->bmiHeader.biBitCount = 8; + pbmi->bmiHeader.biCompression = BI_RGB; + pbmi->bmiHeader.biSizeImage = 0; + pbmi->bmiHeader.biXPelsPerMeter = 1; + pbmi->bmiHeader.biYPelsPerMeter = 1; + pbmi->bmiHeader.biClrUsed = 3; + pbmi->bmiHeader.biClrImportant = 0; + bmibuffer.bmiColors[0] = 0xff0000; + bmibuffer.bmiColors[1] = 0x00ff00; + bmibuffer.bmiColors[2] = 0x0000ff; + + hbmp = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (PVOID*)&pjBits, 0, 0 ); + ok( hbmp != NULL, "error=%ld\n", GetLastError() ); + SelectObject(hdc, hbmp); + + cColors = GetDIBColorTable(hdc, 0, 257, (RGBQUAD*)aulColors); + ok_long(cColors, 256); + ok_long(aulColors[0], 0xff0000); + ok_long(aulColors[1], 0x00ff00); + ok_long(aulColors[2], 0x0000ff); + ok_long(aulColors[3], 0x000000); + + + cColors = SetDIBColorTable(hdc, 0, 4, (RGBQUAD*)aulColors); + ok_long(cColors, 4); + + aulColors[3] = 0x000F0F; + cColors = SetDIBColorTable(hdc, 0, 4, (RGBQUAD*)aulColors); + ok_long(cColors, 4); + + cColors = GetDIBColorTable(hdc, 0, 257, (RGBQUAD*)aulColors); + ok_long(cColors, 256); + ok_long(aulColors[0], 0xff0000); + ok_long(aulColors[1], 0x00ff00); + ok_long(aulColors[2], 0x0000ff); + ok_long(aulColors[3], 0x000F0F); + + + SelectObject(hdc, GetStockObject(21)); + DeleteObject(hbmp); + + bmibuffer.bmiColors[0] = 1; + bmibuffer.bmiColors[1] = 2; + bmibuffer.bmiColors[2] = 3; + + hbmp = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (PVOID*)&pjBits, 0, 0 ); + ok( hbmp != NULL, "error=%ld\n", GetLastError() ); + SelectObject(hdc, hbmp); + + +} + +START_TEST(GetDIBColorTable) +{ + Test_GetDIBColorTable(); +} + Propchange: trunk/rostests/apitests/gdi32/GetDIBColorTable.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/gdi32/GetPixel.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetPixel.c…
============================================================================== --- trunk/rostests/apitests/gdi32/GetPixel.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetPixel.c [iso-8859-1] Fri May 4 11:40:36 2012 @@ -28,6 +28,13 @@ color = GetPixel(hdc, 1, 0); ok(color == 0, "Wrong color at 1,0 : 0x%08x\n", (UINT)color); + SetBkColor(hdc, 0x0000FF); + SetTextColor(hdc, 0x00FF00); + color = GetPixel(hdc, 0, 0); + ok(color == 0xFFFFFF, "Wrong color at 0,0 : 0x%08x\n", (UINT)color); + color = GetPixel(hdc, 1, 0); + ok(color == 0, "Wrong color at 1,0 : 0x%08x\n", (UINT)color); + SetBkColor(hdc, 0x12345678); SetTextColor(hdc, 0x87654321); color = GetPixel(hdc, 0, 0); Modified: trunk/rostests/apitests/gdi32/PatBlt.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/PatBlt.c?r…
============================================================================== --- trunk/rostests/apitests/gdi32/PatBlt.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/PatBlt.c [iso-8859-1] Fri May 4 11:40:36 2012 @@ -12,6 +12,68 @@ HBITMAP ghbmpTarget; PULONG gpulTargetBits; HDC hdcTarget; + +void Test_PatBlt_Params() +{ + BOOL ret; + ULONG i, rop; + HDC hdc; + + /* Test a rop that contains only the operation index */ + ret = PatBlt(hdcTarget, 0, 0, 1, 1, PATCOPY & 0x00FF0000); + ok_long(ret, 1); + + /* Test an invalid rop */ + SetLastError(0); + ok_long(PatBlt(hdcTarget, 0, 0, 1, 1, SRCCOPY) , 0); + ok_err(0); + + /* Test all rops */ + for (i = 0; i < 256; i++) + { + rop = i << 16; + ret = PatBlt(hdcTarget, 0, 0, 1, 1, rop); + + /* Only these should succeed (they use no source) */ + if ((i == 0) || (i == 5) || (i == 10) || (i == 15) || (i == 80) || + (i == 85) || (i == 90) || (i == 95) || (i == 160) || (i == 165) || + (i == 170) || (i == 175) || (i == 240) || (i == 245) || + (i == 250) || (i == 255)) + { + ok(ret == 1, "index %ld failed, but should succeed\n", i); + } + else + { + ok(ret == 0, "index %ld succeeded, but should fail\n", i); + } + } + + /* Test quaternary rop, the background part is simply ignored */ + ret = PatBlt(hdcTarget, 0, 0, 1, 1, MAKEROP4(PATCOPY, PATINVERT)); + ok_long(ret, 1); + ret = PatBlt(hdcTarget, 0, 0, 1, 1, MAKEROP4(PATCOPY, SRCCOPY)); + ok_long(ret, 1); + ret = PatBlt(hdcTarget, 0, 0, 1, 1, MAKEROP4(SRCCOPY, PATCOPY)); + ok_long(ret, 0); + + /* Test an info DC */ + hdc = CreateICA("DISPLAY", NULL, NULL, NULL); + ok(hdc != 0, "\n"); + SetLastError(0); + ok_long(PatBlt(hdc, 0, 0, 1, 1, PATCOPY), 1); + ok_err(0); + DeleteDC(hdc); + + /* Test a mem DC without selecting a bitmap */ + hdc = CreateCompatibleDC(NULL); + ok(hdc != 0, "\n"); + ok_long(PatBlt(hdc, 0, 0, 1, 1, PATCOPY), 1); + ok_err(0); + DeleteDC(hdc); + + + +} void Test_BrushOrigin() { @@ -100,6 +162,10 @@ return; } + Test_PatBlt_Params(); + Test_BrushOrigin(); + + } Added: trunk/rostests/apitests/gdi32/SetPixel.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/SetPixel.c…
============================================================================== --- trunk/rostests/apitests/gdi32/SetPixel.c (added) +++ trunk/rostests/apitests/gdi32/SetPixel.c [iso-8859-1] Fri May 4 11:40:36 2012 @@ -1,0 +1,187 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for SetPixel + * PROGRAMMERS: Timo Kreuzer + */ + +#include <stdio.h> +#include <wine/test.h> +#include <windows.h> + +static struct +{ + WORD palVersion; + WORD palNumEntries; + PALETTEENTRY logpalettedata[8]; +} gpal = +{ + 0x300, 8, + { + { 0x10, 0x20, 0x30, PC_NOCOLLAPSE }, + { 0x20, 0x30, 0x40, PC_NOCOLLAPSE }, + { 0x30, 0x40, 0x50, PC_NOCOLLAPSE }, + { 0x40, 0x50, 0x60, PC_NOCOLLAPSE }, + { 0x50, 0x60, 0x70, PC_NOCOLLAPSE }, + { 0x60, 0x70, 0x80, PC_NOCOLLAPSE }, + { 0x70, 0x80, 0x90, PC_NOCOLLAPSE }, + { 0x80, 0x90, 0xA0, PC_NOCOLLAPSE }, + } +}; + +void Test_SetPixel_Params() +{ + HDC hdc; + + SetLastError(0); + ok_long(SetPixel(0, 0, 0, RGB(255,255,255)), -1); + ok_err(ERROR_INVALID_HANDLE); + + /* Test an info DC */ + hdc = CreateICA("DISPLAY", NULL, NULL, NULL); + ok(hdc != 0, "\n"); + SetLastError(0); + ok_long(SetPixel(hdc, 0, 0, 0), -1); + ok_long(SetPixel(hdc, 0, 0, RGB(255,255,255)), -1); + ok_err(0); + DeleteDC(hdc); + + /* Test a mem DC without selecting a bitmap */ + hdc = CreateCompatibleDC(NULL); + ok(hdc != 0, "\n"); + SetLastError(0); + ok_long(SetPixel(hdc, 0, 0, 0), -1); + ok_err(0); + DeleteDC(hdc); + + /* Test deleted DC */ + ok_long(SetPixel(hdc, 0, 0, 0), -1); + +} + +void Test_SetPixel_PAL() +{ + struct + { + BITMAPINFOHEADER bmiHeader; + WORD bmiColors[8]; + } bmibuffer; + BITMAPINFO *pbmi = (PVOID)&bmibuffer; + HBITMAP hbmp; + HDC hdc; + HPALETTE hpal, hpalOld; + PULONG pulBits; + ULONG i; + + /* Initialize the BITMAPINFO */ + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biWidth = 1; + pbmi->bmiHeader.biHeight = 1; + pbmi->bmiHeader.biPlanes = 1; + pbmi->bmiHeader.biBitCount = 8; + pbmi->bmiHeader.biCompression = BI_RGB; + pbmi->bmiHeader.biSizeImage = 0; + pbmi->bmiHeader.biXPelsPerMeter = 1; + pbmi->bmiHeader.biYPelsPerMeter = 1; + pbmi->bmiHeader.biClrUsed = 8; + pbmi->bmiHeader.biClrImportant = 0; + for( i = 0; i < 8; i++ ) + { + bmibuffer.bmiColors[i] = i + 1; + } + + /* Create a memory DC */ + hdc = CreateCompatibleDC(0); + ok(hdc != 0, "failed\n"); + + /* Create a DIB section and select it */ + hbmp = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (PVOID*)&pulBits, 0, 0 ); + ok(hbmp != NULL, "CreateDIBSection failed with error %ld\n", GetLastError()); + ok(SelectObject(hdc, hbmp) != 0, "SelectObject failed\n"); + + ok_long(SetPixel(hdc, 0, 0, 0), 0); + ok_long(pulBits[0], 8); + ok_long(SetPixel(hdc, 0, 0, 1), 0); + ok_long(pulBits[0], 8); + ok_long(SetPixel(hdc, 0, 0, RGB(255,255,255)), 0xc0dcc0); + ok_long(pulBits[0], 7); + + ok_long(SetPixel(hdc, 0, 0, RGB(255,0,0)), 0x80); + ok_long(pulBits[0], 0); + + /* Test DIBINDEX */ + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(0)), 0x80); + ok_long(pulBits[0], 0); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(1)), 0x8000); + ok_long(pulBits[0], 1); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(7)), 0xc0dcc0); + ok_long(pulBits[0], 7); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(8)), 0); + ok_long(pulBits[0], 8); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(126)), 0); + ok_long(pulBits[0], 126); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(0x123456)), 0); + ok_long(pulBits[0], 0x56); + + /* Test PALETTEINDEX */ + ok_long(SetPixel(hdc, 0, 0, PALETTEINDEX(0)), 0); + ok_long(pulBits[0], 8); + ok_long(SetPixel(hdc, 0, 0, PALETTEINDEX(1)), 0x80); + ok_long(pulBits[0], 0); + ok_long(SetPixel(hdc, 0, 0, PALETTEINDEX(2)), 0x8000); + ok_long(pulBits[0], 1); + + /* Delete the DIB section */ + DeleteObject(hbmp); + + + /* Initialize the logical palette and select it */ + hpal = CreatePalette((LOGPALETTE*)&gpal); + hpalOld = SelectPalette(hdc, hpal, FALSE); + ok(hpalOld != NULL, "error=%ld\n", GetLastError()); + + + /* Create a DIB section and select it */ + hbmp = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (PVOID*)&pulBits, 0, 0 ); + ok(hbmp != NULL, "CreateDIBSection failed with error %ld\n", GetLastError()); + ok(SelectObject(hdc, hbmp) != 0, "SelectObject failed\n"); + + ok_long(SetPixel(hdc, 0, 0, 0), 0); + ok_long(pulBits[0], 8); + + ok_long(SetPixel(hdc, 0, 0, RGB(255,0,0)), 0x605040); + ok_long(pulBits[0], 2); + + /* Test DIBINDEX */ + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(0)), 0x403020); + ok_long(pulBits[0], 0); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(1)), 0x504030); + ok_long(pulBits[0], 1); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(7)), 0x302010); + ok_long(pulBits[0], 7); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(8)), 0); + ok_long(pulBits[0], 8); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(126)), 0); + ok_long(pulBits[0], 126); + ok_long(SetPixel(hdc, 0, 0, DIBINDEX(0x123456)), 0); + ok_long(pulBits[0], 0x56); + + /* Test PALETTEINDEX */ + ok_long(SetPixel(hdc, 0, 0, PALETTEINDEX(0)), 0x302010); + ok_long(pulBits[0], 7); + ok_long(SetPixel(hdc, 0, 0, PALETTEINDEX(1)), 0x403020); + ok_long(pulBits[0], 0); + ok_long(SetPixel(hdc, 0, 0, PALETTEINDEX(253)), 0x302010); + ok_long(pulBits[0], 7); + ok_long(SetPixel(hdc, 0, 0, PALETTEINDEX(254)), 0x302010); + ok_long(pulBits[0], 7); + + +} + +START_TEST(SetPixel) +{ + Test_SetPixel_Params(); + Test_SetPixel_PAL(); +} + Propchange: trunk/rostests/apitests/gdi32/SetPixel.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/gdi32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/testlist.c…
============================================================================== --- trunk/rostests/apitests/gdi32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/testlist.c [iso-8859-1] Fri May 4 11:40:36 2012 @@ -39,6 +39,7 @@ extern void func_GdiSetAttrs(void); extern void func_GetClipRgn(void); extern void func_GetCurrentObject(void); +extern void func_GetDIBColorTable(void); extern void func_GetDIBits(void); extern void func_GetPixel(void); extern void func_GetObject(void); @@ -50,9 +51,11 @@ extern void func_PatBlt(void); extern void func_Rectangle(void); extern void func_SelectObject(void); +extern void func_SetBrushOrgEx(void); extern void func_SetDCPenColor(void); extern void func_SetDIBits(void); extern void func_SetMapMode(void); +extern void func_SetPixel(void); extern void func_SetSysColors(void); extern void func_SetWindowExtEx(void); extern void func_SetWorldTransform(void); @@ -93,6 +96,7 @@ { "GdiSetAttrs", func_GdiSetAttrs }, { "GetClipRgn", func_GetClipRgn }, { "GetCurrentObject", func_GetCurrentObject }, + { "GetDIBColorTable", func_GetDIBColorTable }, { "GetDIBits", func_GetDIBits }, { "GetPixel", func_GetPixel }, { "GetObject", func_GetObject }, @@ -104,9 +108,11 @@ { "PatBlt", func_PatBlt }, { "Rectangle", func_Rectangle }, { "SelectObject", func_SelectObject }, + { "SetBrushOrgEx", func_SetBrushOrgEx }, { "SetDCPenColor", func_SetDCPenColor }, { "SetDIBits", func_SetDIBits }, { "SetMapMode", func_SetMapMode }, + { "SetPixel", func_SetPixel }, { "SetSysColors", func_SetSysColors }, { "SetWindowExtEx", func_SetWindowExtEx }, { "SetWorldTransform", func_SetWorldTransform },
12 years, 7 months
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
23
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
Results per page:
10
25
50
100
200