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
June 2008
----- 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
23 participants
435 discussions
Start a n
N
ew thread
[tkreuzer] 33996: IntEngGradientFill: fix cleanup when calling the driver
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 16 13:56:52 2008 New Revision: 33996 URL:
http://svn.reactos.org/svn/reactos?rev=33996&view=rev
Log: IntEngGradientFill: fix cleanup when calling the driver Modified: trunk/reactos/subsystems/win32/win32k/eng/gradient.c Modified: trunk/reactos/subsystems/win32/win32k/eng/gradient.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/gradient.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/gradient.c [iso-8859-1] Mon Jun 16 13:56:52 2008 @@ -571,11 +571,12 @@ Ret = GDIDEVFUNCS(psoDest).GradientFill( psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, prclExtents, pptlDitherOrg, ulMode); - MouseSafetyOnDrawEnd(psoDest); - return Ret; - } - Ret = EngGradientFill(psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, prclExtents, - pptlDitherOrg, ulMode); + } + else + { + Ret = EngGradientFill(psoDest, pco, pxlo, pVertex, nVertex, pMesh, nMesh, prclExtents, + pptlDitherOrg, ulMode); + } MouseSafetyOnDrawEnd(psoDest); BITMAPOBJ_UnlockBitmapBits(pboDest);
16 years, 6 months
1
0
0
0
[tkreuzer] 33995: - print out when process takes too much gdi handles - GDIOBJ_FreeObjByHandly: unlock handle table entry when object to delete was locked - REGION_AllocRgnWithHandle: unlock region before trying to delete it on failure Now gdi32_winetest clipping doesn't freeze ros anymore
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 16 13:27:18 2008 New Revision: 33995 URL:
http://svn.reactos.org/svn/reactos?rev=33995&view=rev
Log: - print out when process takes too much gdi handles - GDIOBJ_FreeObjByHandly: unlock handle table entry when object to delete was locked - REGION_AllocRgnWithHandle: unlock region before trying to delete it on failure Now gdi32_winetest clipping doesn't freeze ros anymore Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c trunk/reactos/subsystems/win32/win32k/objects/region.c Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] Mon Jun 16 13:27:18 2008 @@ -323,7 +323,11 @@ /* HACK HACK HACK: simplest-possible quota implementation - don't allow a process to take too many GDI objects, itself. */ if (W32Process && W32Process->GDIObjects >= 0x2710) + { + DPRINT1("Too many objects for process!!!\n"); + GDIDBG_DUMPHANDLETABLE(); return NULL; + } ASSERT(ObjectType != GDI_OBJECT_TYPE_DONTCARE); @@ -539,6 +543,7 @@ DPRINT1("Object->cExclusiveLock = %d\n", Object->cExclusiveLock); GDIDBG_TRACECALLER(); GDIDBG_TRACELOCKER(GDI_HANDLE_GET_INDEX(hObj)); + (void)_InterlockedExchangePointer((PVOID*)&Entry->ProcessId, PrevProcId); /* do not assert here for it will call again from dxg.sys it being call twice */ //ASSERT(FALSE); } Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/region.c [iso-8859-1] Mon Jun 16 13:27:18 2008 @@ -2053,6 +2053,7 @@ pReg->Buffer = ExAllocatePoolWithTag(PagedPool, nReg * sizeof(RECT), TAG_REGION); if (!pReg->Buffer) { + REGION_UnlockRgn(pReg); GDIOBJ_FreeObjByHandle(hReg, GDI_OBJECT_TYPE_REGION); return NULL; }
16 years, 6 months
1
0
0
0
[tkreuzer] 33994: - add test for GdiGetCharDimension - fix a test name - comment out more tests for EngReleaseSemaphore, they cause heap corruption on ros - convert more TEST -> RTEST
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 16 10:24:05 2008 New Revision: 33994 URL:
http://svn.reactos.org/svn/reactos?rev=33994&view=rev
Log: - add test for GdiGetCharDimension - fix a test name - comment out more tests for EngReleaseSemaphore, they cause heap corruption on ros - convert more TEST -> RTEST Added: trunk/rostests/apitests/gdi32api/tests/GdiGetCharDimensions.c (with props) Modified: trunk/rostests/apitests/gdi32api/testlist.c trunk/rostests/apitests/gdi32api/tests/AddFontResource.c trunk/rostests/apitests/gdi32api/tests/AddFontResourceEx.c trunk/rostests/apitests/gdi32api/tests/EngReleaseSemaphore.c trunk/rostests/apitests/gdi32api/tests/GetClipRgn.c trunk/rostests/apitests/gdi32api/tests/GetCurrentObject.c trunk/rostests/apitests/gdi32api/tests/GetObject.c trunk/rostests/apitests/gdi32api/tests/GetStockObject.c trunk/rostests/apitests/gdi32api/tests/SelectObject.c trunk/rostests/apitests/gdi32api/tests/SetDCPenColor.c Modified: trunk/rostests/apitests/gdi32api/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/testlis…
============================================================================== --- trunk/rostests/apitests/gdi32api/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/testlist.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -23,6 +23,7 @@ #include "tests/GdiConvertPalette.c" #include "tests/GdiConvertRegion.c" #include "tests/GdiDeleteLocalDC.c" +#include "tests/GdiGetCharDimensions.c" #include "tests/GdiGetLocalBrush.c" #include "tests/GdiGetLocalDC.c" #include "tests/GdiReleaseLocalDC.c" @@ -63,11 +64,12 @@ { L"ExtCreatePen", Test_ExtCreatePen }, { L"GdiConvertBitmap", Test_GdiConvertBitmap }, { L"GdiConvertBrush", Test_GdiConvertBrush }, - { L"GdiConvertBrush", Test_GdiConvertDC }, + { L"GdiConvertDC", Test_GdiConvertDC }, { L"GdiConvertFont", Test_GdiConvertFont }, { L"GdiConvertPalette", Test_GdiConvertPalette }, { L"GdiConvertRegion", Test_GdiConvertRegion }, { L"GdiDeleteLocalDC", Test_GdiDeleteLocalDC }, + { L"GdiGetCharDimensions", Test_GdiGetCharDimensions }, { L"GdiGetLocalBrush", Test_GdiGetLocalBrush }, { L"GdiGetLocalDC", Test_GdiGetLocalDC }, { L"GdiReleaseLocalDC", Test_GdiReleaseLocalDC }, Modified: trunk/rostests/apitests/gdi32api/tests/AddFontResource.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/A…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/AddFontResource.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/AddFontResource.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -23,39 +23,48 @@ /* Testing NULL pointer */ SetLastError(ERROR_SUCCESS); - TEST(AddFontResourceA(NULL) == 0); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(AddFontResourceA(NULL) == 0); + RTEST(GetLastError() == ERROR_SUCCESS); /* Testing -1 pointer */ SetLastError(ERROR_SUCCESS); - TEST(AddFontResourceA((CHAR*)-1) == 0); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(AddFontResourceA((CHAR*)-1) == 0); + RTEST(GetLastError() == ERROR_SUCCESS); /* Testing address 1 pointer */ SetLastError(ERROR_SUCCESS); - TEST(AddFontResourceA((CHAR*)1) == 0); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(AddFontResourceA((CHAR*)1) == 0); + RTEST(GetLastError() == ERROR_SUCCESS); /* Testing address empty string */ SetLastError(ERROR_SUCCESS); - TEST(AddFontResourceA("") == 0); + RTEST(AddFontResourceA("") == 0); TEST(GetLastError() == ERROR_INVALID_PARAMETER); /* Testing one ttf font */ SetLastError(ERROR_SUCCESS); TEST(AddFontResourceA(szFileNameFont1A) == 1); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetLastError() == ERROR_SUCCESS); /* Testing one otf font */ SetLastError(ERROR_SUCCESS); TEST(AddFontResourceA(szFileNameFont2A) == 1); + RTEST(GetLastError() == ERROR_SUCCESS); + + /* Testing two fonts */ + SetLastError(ERROR_SUCCESS); + sprintf(szFileNameA,"%s|%s",szFileNameFont1A, szFileNameFont2A); + TEST(AddFontResourceA(szFileNameA) == 0); TEST(GetLastError() == ERROR_SUCCESS); - /* Testing two font */ + SetLastError(ERROR_SUCCESS); + sprintf(szFileNameA,"%s |%s",szFileNameFont1A, szFileNameFont2A); + TEST(AddFontResourceA(szFileNameA) == 0); + TEST(GetLastError() == ERROR_SUCCESS); + SetLastError(ERROR_SUCCESS); sprintf(szFileNameA,"%s | %s",szFileNameFont1A, szFileNameFont2A); TEST(AddFontResourceA(szFileNameA) == 0); - printf("%x\n",(INT)GetLastError()); TEST(GetLastError() == ERROR_FILE_NOT_FOUND); return APISTATUS_NORMAL; Modified: trunk/rostests/apitests/gdi32api/tests/AddFontResourceEx.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/A…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/AddFontResourceEx.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/AddFontResourceEx.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -13,7 +13,7 @@ /* Test "" filename */ SetLastError(ERROR_SUCCESS); - TEST(AddFontResourceExW(L"", 0, 0) == 0); + RTEST(AddFontResourceExW(L"", 0, 0) == 0); TEST(GetLastError() == ERROR_INVALID_PARAMETER); GetEnvironmentVariableW(L"systemroot", szFileName, MAX_PATH); @@ -22,11 +22,11 @@ /* Test flags = 0 */ SetLastError(ERROR_SUCCESS); TEST(AddFontResourceExW(szFileName, 0, 0) != 0); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetLastError() == ERROR_SUCCESS); SetLastError(ERROR_SUCCESS); - TEST(AddFontResourceExW(szFileName, 256, 0) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + RTEST(AddFontResourceExW(szFileName, 256, 0) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); /* Test invalid pointer as last parameter */ TEST(AddFontResourceExW(szFileName, 0, (void*)-1) != 0); Modified: trunk/rostests/apitests/gdi32api/tests/EngReleaseSemaphore.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/E…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/EngReleaseSemaphore.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/EngReleaseSemaphore.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -29,12 +29,12 @@ EngDeleteSemaphore(hsem); /* try with deleted Semaphore */ - EngReleaseSemaphore(hsem); +// EngReleaseSemaphore(hsem); -> this leads to heap correuption // RTEST (lpcrit->LockCount > 0); - RTEST (lpcrit->RecursionCount != 0); - RTEST (lpcrit->OwningThread == 0); - RTEST (lpcrit->LockSemaphore == 0); - RTEST (lpcrit->SpinCount == 0); +// RTEST (lpcrit->RecursionCount != 0); +// RTEST (lpcrit->OwningThread == 0); +// RTEST (lpcrit->LockSemaphore == 0); +// RTEST (lpcrit->SpinCount == 0); // ASSERT(lpcrit->DebugInfo != NULL); // RTEST (lpcrit->DebugInfo->Type != 0); Added: trunk/rostests/apitests/gdi32api/tests/GdiGetCharDimensions.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/G…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/GdiGetCharDimensions.c (added) +++ trunk/rostests/apitests/gdi32api/tests/GdiGetCharDimensions.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -1,0 +1,27 @@ +LONG STDCALL GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *); + +INT +Test_GdiGetCharDimensions(PTESTINFO pti) +{ + LOGFONT logfont = {-11, 0, 0, 0, 400, + 0, 0, 0, 0, 0, 0, 0, 0, + "MS Shell Dlg 2"}; + HFONT hFont, hOldFont; + HDC hDC; + LONG x,y; + TEXTMETRICW tm; + + hFont = CreateFontIndirect(&logfont); + hDC = CreateCompatibleDC(NULL); + hOldFont = SelectObject(hDC, hFont); + + x = GdiGetCharDimensions(hDC, &tm, &y); + + RTEST(y == tm.tmHeight); + + SelectObject(hDC, hOldFont); + DeleteObject(hFont); + DeleteDC(hDC); + + return APISTATUS_NORMAL; +} Propchange: trunk/rostests/apitests/gdi32api/tests/GdiGetCharDimensions.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/gdi32api/tests/GetClipRgn.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/G…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/GetClipRgn.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/GetClipRgn.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -15,13 +15,13 @@ /* Test invalid DC */ SetLastError(ERROR_SUCCESS); - TEST(GetClipRgn((HDC)0x12345, hrgn) == -1); + RTEST(GetClipRgn((HDC)0x12345, hrgn) == -1); TEST(GetLastError() == ERROR_INVALID_PARAMETER); /* Test invalid hrgn */ SetLastError(ERROR_SUCCESS); - TEST(GetClipRgn(hDC, (HRGN)0x12345) == 0); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetClipRgn(hDC, (HRGN)0x12345) == 0); + RTEST(GetLastError() == ERROR_SUCCESS); ReleaseDC(hWnd, hDC); DestroyWindow(hWnd); Modified: trunk/rostests/apitests/gdi32api/tests/GetCurrentObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/G…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/GetCurrentObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/GetCurrentObject.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -14,122 +14,122 @@ /* Test NULL DC */ SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(NULL, 0) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + RTEST(GetCurrentObject(NULL, 0) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(NULL, OBJ_BITMAP) == 0); - TEST(GetCurrentObject(NULL, OBJ_BRUSH) == 0); - TEST(GetCurrentObject(NULL, OBJ_COLORSPACE) == 0); - TEST(GetCurrentObject(NULL, OBJ_FONT) == 0); - TEST(GetCurrentObject(NULL, OBJ_PAL) == 0); - TEST(GetCurrentObject(NULL, OBJ_PEN) == 0); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(NULL, OBJ_BITMAP) == 0); + RTEST(GetCurrentObject(NULL, OBJ_BRUSH) == 0); + RTEST(GetCurrentObject(NULL, OBJ_COLORSPACE) == 0); + RTEST(GetCurrentObject(NULL, OBJ_FONT) == 0); + RTEST(GetCurrentObject(NULL, OBJ_PAL) == 0); + RTEST(GetCurrentObject(NULL, OBJ_PEN) == 0); + RTEST(GetLastError() == ERROR_SUCCESS); /* Test invalid DC handle */ SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject((HDC)-123, 0) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + RTEST(GetCurrentObject((HDC)-123, 0) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject((HDC)-123, OBJ_BITMAP) == 0); + RTEST(GetCurrentObject((HDC)-123, OBJ_BITMAP) == 0); TEST(GetLastError() == ERROR_SUCCESS); /* Test invalid types */ SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, 0) == 0); + RTEST(GetCurrentObject(hDC, 0) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); + + SetLastError(ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, 3) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); + + SetLastError(ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, 4) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); + + SetLastError(ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, 8) == 0); TEST(GetLastError() == ERROR_INVALID_PARAMETER); SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, 3) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + RTEST(GetCurrentObject(hDC, 9) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, 4) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + RTEST(GetCurrentObject(hDC, 10) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, 8) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + RTEST(GetCurrentObject(hDC, 12) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, 9) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); - - SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, 10) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); - - SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, 12) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); - - SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, 13) == 0); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + RTEST(GetCurrentObject(hDC, 13) == 0); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); /* Default bitmap */ SetLastError(ERROR_SUCCESS); HBITMAP hBmp; hBmp = GetCurrentObject(hDC, OBJ_BITMAP); - TEST(GDI_HANDLE_GET_TYPE(hBmp) == GDI_OBJECT_TYPE_BITMAP); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GDI_HANDLE_GET_TYPE(hBmp) == GDI_OBJECT_TYPE_BITMAP); + RTEST(GetLastError() == ERROR_SUCCESS); /* Other bitmap */ SetLastError(ERROR_SUCCESS); SelectObject(hDC, GetStockObject(21)); - TEST(hBmp == GetCurrentObject(hDC, OBJ_BITMAP)); - TEST(GDI_HANDLE_GET_TYPE(hBmp) == GDI_OBJECT_TYPE_BITMAP); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(hBmp == GetCurrentObject(hDC, OBJ_BITMAP)); + RTEST(GDI_HANDLE_GET_TYPE(hBmp) == GDI_OBJECT_TYPE_BITMAP); + RTEST(GetLastError() == ERROR_SUCCESS); /* Default brush */ SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, OBJ_BRUSH) == GetStockObject(WHITE_BRUSH)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, OBJ_BRUSH) == GetStockObject(WHITE_BRUSH)); + RTEST(GetLastError() == ERROR_SUCCESS); /* Other brush */ SetLastError(ERROR_SUCCESS); SelectObject(hDC, GetStockObject(BLACK_BRUSH)); - TEST(GetCurrentObject(hDC, OBJ_BRUSH) == GetStockObject(BLACK_BRUSH)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, OBJ_BRUSH) == GetStockObject(BLACK_BRUSH)); + RTEST(GetLastError() == ERROR_SUCCESS); /* Default colorspace */ SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, OBJ_COLORSPACE) == GetStockObject(20)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, OBJ_COLORSPACE) == GetStockObject(20)); + RTEST(GetLastError() == ERROR_SUCCESS); /* Default font */ SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, OBJ_FONT) == GetStockObject(SYSTEM_FONT)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, OBJ_FONT) == GetStockObject(SYSTEM_FONT)); + RTEST(GetLastError() == ERROR_SUCCESS); /* Other font */ SetLastError(ERROR_SUCCESS); SelectObject(hDC, GetStockObject(DEFAULT_GUI_FONT)); - TEST(GetCurrentObject(hDC, OBJ_FONT) == GetStockObject(DEFAULT_GUI_FONT)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, OBJ_FONT) == GetStockObject(DEFAULT_GUI_FONT)); + RTEST(GetLastError() == ERROR_SUCCESS); /* Default palette */ SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, OBJ_PAL) == GetStockObject(DEFAULT_PALETTE)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, OBJ_PAL) == GetStockObject(DEFAULT_PALETTE)); + RTEST(GetLastError() == ERROR_SUCCESS); /* Default pen */ SetLastError(ERROR_SUCCESS); - TEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(BLACK_PEN)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(BLACK_PEN)); + RTEST(GetLastError() == ERROR_SUCCESS); /* Other pen */ SetLastError(ERROR_SUCCESS); SelectObject(hDC, GetStockObject(WHITE_PEN)); - TEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(WHITE_PEN)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(WHITE_PEN)); + RTEST(GetLastError() == ERROR_SUCCESS); /* DC pen */ SetLastError(ERROR_SUCCESS); SelectObject(hDC, GetStockObject(DC_PEN)); - TEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(DC_PEN)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetCurrentObject(hDC, OBJ_PEN) == GetStockObject(DC_PEN)); + RTEST(GetLastError() == ERROR_SUCCESS); ReleaseDC(hWnd, hDC); DestroyWindow(hWnd); Modified: trunk/rostests/apitests/gdi32api/tests/GetObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/G…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/GetObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/GetObject.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -11,50 +11,50 @@ /* Test null pointer and invalid handles */ SetLastError(ERROR_SUCCESS); - TEST(GetObjectA(0, 0, NULL) == 0); - TEST(GetObjectA((HANDLE)-1, 0, NULL) == 0); - TEST(GetObjectA((HANDLE)0x00380000, 0, NULL) == 0); - TEST(GetLastError() == ERROR_SUCCESS); - - SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - SetLastError(ERROR_SUCCESS); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - SetLastError(ERROR_SUCCESS); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - SetLastError(ERROR_SUCCESS); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - SetLastError(ERROR_SUCCESS); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - SetLastError(ERROR_SUCCESS); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); + RTEST(GetObjectA(0, 0, NULL) == 0); + RTEST(GetObjectA((HANDLE)-1, 0, NULL) == 0); + RTEST(GetObjectA((HANDLE)0x00380000, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_SUCCESS); + + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); /* Test need of alignment */ hBrush = GetStockObject(WHITE_BRUSH); plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush); - TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH)); + RTEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH)); plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 2); - TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH)); + RTEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH)); plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 1); - TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0); + RTEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0); return TRUE; } @@ -73,21 +73,21 @@ if (!hBitmap) return FALSE; SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP)); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP)); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), NULL) == sizeof(BITMAP)); - TEST(GetObjectA(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP)); - TEST(GetObjectA(hBitmap, 0, NULL) == sizeof(BITMAP)); - TEST(GetObjectA((HANDLE)((UINT)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP)); - TEST(GetObjectA(hBitmap, 5, NULL) == sizeof(BITMAP)); - TEST(GetObjectA(hBitmap, -5, NULL) == sizeof(BITMAP)); - TEST(GetObjectA(hBitmap, 0, Buffer) == 0); - TEST(GetObjectA(hBitmap, 5, Buffer) == 0); - TEST(GetObjectA(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); - TEST(GetObjectA(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP)); - TEST(GetObjectA(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(BITMAP)); - TEST(GetObjectA(hBitmap, -5, &bitmap) == sizeof(BITMAP)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP)); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP)); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), NULL) == sizeof(BITMAP)); + RTEST(GetObjectA(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP)); + RTEST(GetObjectA(hBitmap, 0, NULL) == sizeof(BITMAP)); + RTEST(GetObjectA((HANDLE)((UINT)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP)); + RTEST(GetObjectA(hBitmap, 5, NULL) == sizeof(BITMAP)); + RTEST(GetObjectA(hBitmap, -5, NULL) == sizeof(BITMAP)); + RTEST(GetObjectA(hBitmap, 0, Buffer) == 0); + RTEST(GetObjectA(hBitmap, 5, Buffer) == 0); + RTEST(GetObjectA(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP)); + RTEST(GetObjectA(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP)); + RTEST(GetObjectA(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(BITMAP)); + RTEST(GetObjectA(hBitmap, -5, &bitmap) == sizeof(BITMAP)); + RTEST(GetLastError() == ERROR_SUCCESS); // todo: test invalid handle + buffer @@ -109,18 +109,18 @@ if(!hBitmap) return FALSE; SetLastError(ERROR_SUCCESS); - TEST(GetObject(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP)); - TEST(GetObject(hBitmap, 0, NULL) == sizeof(BITMAP)); - TEST(GetObject(hBitmap, 5, NULL) == sizeof(BITMAP)); - TEST(GetObject(hBitmap, -5, NULL) == sizeof(BITMAP)); - TEST(GetObject(hBitmap, 0, &dibsection) == 0); - TEST(GetObject(hBitmap, 5, &dibsection) == 0); - TEST(GetObject(hBitmap, sizeof(BITMAP), &dibsection) == sizeof(BITMAP)); - TEST(GetObject(hBitmap, sizeof(BITMAP)+2, &dibsection) == sizeof(BITMAP)); - TEST(GetObject(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(DIBSECTION)); - TEST(GetObject(hBitmap, sizeof(DIBSECTION)+2, &dibsection) == sizeof(DIBSECTION)); - TEST(GetObject(hBitmap, -5, &dibsection) == sizeof(DIBSECTION)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetObject(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP)); + RTEST(GetObject(hBitmap, 0, NULL) == sizeof(BITMAP)); + RTEST(GetObject(hBitmap, 5, NULL) == sizeof(BITMAP)); + RTEST(GetObject(hBitmap, -5, NULL) == sizeof(BITMAP)); + RTEST(GetObject(hBitmap, 0, &dibsection) == 0); + RTEST(GetObject(hBitmap, 5, &dibsection) == 0); + RTEST(GetObject(hBitmap, sizeof(BITMAP), &dibsection) == sizeof(BITMAP)); + RTEST(GetObject(hBitmap, sizeof(BITMAP)+2, &dibsection) == sizeof(BITMAP)); + RTEST(GetObject(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(DIBSECTION)); + RTEST(GetObject(hBitmap, sizeof(DIBSECTION)+2, &dibsection) == sizeof(DIBSECTION)); + RTEST(GetObject(hBitmap, -5, &dibsection) == sizeof(DIBSECTION)); + RTEST(GetLastError() == ERROR_SUCCESS); DeleteObject(hBitmap); ReleaseDC(0, hDC); @@ -145,18 +145,18 @@ if (!hPalette) return FALSE; SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD)); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD)); - TEST(GetObject(hPalette, sizeof(WORD), NULL) == sizeof(WORD)); - TEST(GetObject(hPalette, 0, NULL) == sizeof(WORD)); - TEST(GetObject(hPalette, 5, NULL) == sizeof(WORD)); - TEST(GetObject(hPalette, -5, NULL) == sizeof(WORD)); - TEST(GetObject(hPalette, sizeof(WORD), &wPalette) == sizeof(WORD)); - TEST(GetObject(hPalette, sizeof(WORD)+2, &wPalette) == sizeof(WORD)); - TEST(GetObject(hPalette, 0, &wPalette) == 0); - TEST(GetObject(hPalette, 1, &wPalette) == 0); - TEST(GetObject(hPalette, -1, &wPalette) == sizeof(WORD)); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD)); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD)); + RTEST(GetObject(hPalette, sizeof(WORD), NULL) == sizeof(WORD)); + RTEST(GetObject(hPalette, 0, NULL) == sizeof(WORD)); + RTEST(GetObject(hPalette, 5, NULL) == sizeof(WORD)); + RTEST(GetObject(hPalette, -5, NULL) == sizeof(WORD)); + RTEST(GetObject(hPalette, sizeof(WORD), &wPalette) == sizeof(WORD)); + RTEST(GetObject(hPalette, sizeof(WORD)+2, &wPalette) == sizeof(WORD)); + RTEST(GetObject(hPalette, 0, &wPalette) == 0); + RTEST(GetObject(hPalette, 1, &wPalette) == 0); + RTEST(GetObject(hPalette, -1, &wPalette) == sizeof(WORD)); + RTEST(GetLastError() == ERROR_SUCCESS); DeleteObject(hPalette); return TRUE; } @@ -172,10 +172,10 @@ if (!hBrush) return FALSE; SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH)); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH)); - TEST(GetObject(hBrush, sizeof(WORD), NULL) == sizeof(LOGBRUSH)); - TEST(GetObject(hBrush, 0, NULL) == sizeof(LOGBRUSH)); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH)); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH)); + RTEST(GetObject(hBrush, sizeof(WORD), NULL) == sizeof(LOGBRUSH)); + RTEST(GetObject(hBrush, 0, NULL) == sizeof(LOGBRUSH)); RTEST(GetObject(hBrush, 5, NULL) == sizeof(LOGBRUSH)); RTEST(GetObject(hBrush, -5, NULL) == sizeof(LOGBRUSH)); @@ -311,38 +311,38 @@ hFont = CreateFontA(8, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, "testfont"); - TEST(hFont); - - SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTA)); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTW)); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA)); // 60 - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTA), NULL) == sizeof(LOGFONTA)); // 156 - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTA)); // 188 - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTA), NULL) == sizeof(LOGFONTA)); // 192 - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA), NULL) == sizeof(LOGFONTA)); // 260 - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA)+1, NULL) == sizeof(LOGFONTA)); // 260 - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW)); // 92 - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTW), NULL) == sizeof(LOGFONTW)); // 284 - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTW), NULL) == sizeof(LOGFONTW)); // 320 - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXW), NULL) == sizeof(LOGFONTW)); // 348 - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW), NULL) == sizeof(LOGFONTW)); // 420 - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW)+1, NULL) == sizeof(LOGFONTW)); // 356! - - TEST(GetObjectA(hFont, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA)); - TEST(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA)); - TEST(GetObjectA(hFont, 5, NULL) == sizeof(LOGFONTA)); - TEST(GetObjectA(hFont, -5, NULL) == sizeof(LOGFONTA)); - TEST(GetObjectA(hFont, 0, &logfonta) == 0); - TEST(logfonta.lfHeight == 0x77777777); + RTEST(hFont); + + SetLastError(ERROR_SUCCESS); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTA)); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTW)); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA)); // 60 + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTA), NULL) == sizeof(LOGFONTA)); // 156 + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTA)); // 188 + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTA), NULL) == sizeof(LOGFONTA)); // 192 + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA), NULL) == sizeof(LOGFONTA)); // 260 + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA)+1, NULL) == sizeof(LOGFONTA)); // 260 + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW)); // 92 + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTW), NULL) == sizeof(LOGFONTW)); // 284 + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTW), NULL) == sizeof(LOGFONTW)); // 320 + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXW), NULL) == sizeof(LOGFONTW)); // 348 + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW), NULL) == sizeof(LOGFONTW)); // 420 + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW)+1, NULL) == sizeof(LOGFONTW)); // 356! + + RTEST(GetObjectA(hFont, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA)); + RTEST(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA)); + RTEST(GetObjectA(hFont, 5, NULL) == sizeof(LOGFONTA)); + RTEST(GetObjectA(hFont, -5, NULL) == sizeof(LOGFONTA)); + RTEST(GetObjectA(hFont, 0, &logfonta) == 0); + RTEST(logfonta.lfHeight == 0x77777777); TEST(GetObjectA(hFont, 5, &logfonta) == 5); TEST(logfonta.lfHeight == 8); TEST(logfonta.lfWidth == 0x77777708); - TEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60 + RTEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60 TEST(GetObjectA(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTA)); // 92 - TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192 + RTEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192 TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &extlogfonta) == sizeof(EXTLOGFONTA)+1); // 192 TEST(GetObjectA(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(ENUMLOGFONTEXDVA)); // 320 @@ -351,29 +351,29 @@ /* LOGFONT / GetObjectW */ FillMemory(&logfontw, sizeof(LOGFONTW), 0x77); - TEST(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW)); - TEST(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW)); - TEST(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW)); - TEST(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW)); - TEST(GetObjectW(hFont, 0, &logfontw) == 0); - TEST(logfontw.lfHeight == 0x77777777); + RTEST(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW)); + RTEST(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW)); + RTEST(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW)); + RTEST(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW)); + RTEST(GetObjectW(hFont, 0, &logfontw) == 0); + RTEST(logfontw.lfHeight == 0x77777777); TEST(GetObjectW(hFont, 5, &logfontw) == 5); TEST(logfontw.lfHeight == 8); TEST(logfontw.lfWidth == 0x77777708); - TEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60 - TEST(logfonta.lfHeight == 8); - TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTA), &enumlogfonta) == sizeof(ENUMLOGFONTA)); // 156 - TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXA), &enumlogfontexa) == sizeof(ENUMLOGFONTEXA)); // 188 - TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192 - TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA)); // 260 + RTEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60 + RTEST(logfonta.lfHeight == 8); + RTEST(GetObjectA(hFont, sizeof(ENUMLOGFONTA), &enumlogfonta) == sizeof(ENUMLOGFONTA)); // 156 + RTEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXA), &enumlogfontexa) == sizeof(ENUMLOGFONTEXA)); // 188 + RTEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA)); // 192 + RTEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA)); // 260 TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA)); // 260 - TEST(GetObjectW(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTW)); // 92 - TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &enumlogfontw) == sizeof(ENUMLOGFONTW)); // 284 - TEST(GetObjectW(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(EXTLOGFONTW)); // 320 - TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &enumlogfontexw) == sizeof(ENUMLOGFONTEXW)); // 348 + RTEST(GetObjectW(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTW)); // 92 + RTEST(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &enumlogfontw) == sizeof(ENUMLOGFONTW)); // 284 + RTEST(GetObjectW(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(EXTLOGFONTW)); // 320 + RTEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &enumlogfontexw) == sizeof(ENUMLOGFONTEXW)); // 348 TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW), &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD)); // 420 TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW)+1, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD)); // 356! @@ -392,7 +392,7 @@ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 60);// FIXME: what structure? TEST(GetLastError() == ERROR_INSUFFICIENT_BUFFER); SetLastError(ERROR_SUCCESS); - TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 0); + RTEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 0); TEST(GetLastError() == ERROR_INSUFFICIENT_BUFFER); return TRUE; @@ -410,11 +410,11 @@ if(((UINT)hMetaDC & GDI_HANDLE_TYPE_MASK) != GDI_OBJECT_TYPE_METADC) return FALSE; SetLastError(ERROR_SUCCESS); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 0, NULL) == 0); - TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 100, &buffer) == 0); - TEST(GetObjectA(hMetaDC, 0, NULL) == 0); - TEST(GetObjectA(hMetaDC, 100, &buffer) == 0); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 0, NULL) == 0); + RTEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 100, &buffer) == 0); + RTEST(GetObjectA(hMetaDC, 0, NULL) == 0); + RTEST(GetObjectA(hMetaDC, 100, &buffer) == 0); + RTEST(GetLastError() == ERROR_SUCCESS); return TRUE; } @@ -425,8 +425,8 @@ HRGN hRgn; hRgn = CreateRectRgn(0,0,5,5); SetLastError(ERROR_SUCCESS); - TEST(GetObjectW(hRgn, 0, NULL) == 0); - TEST(GetLastError() == ERROR_INVALID_HANDLE); + RTEST(GetObjectW(hRgn, 0, NULL) == 0); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); DeleteObject(hRgn); Test_Font(pti); Modified: trunk/rostests/apitests/gdi32api/tests/GetStockObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/G…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/GetStockObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/GetStockObject.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -5,7 +5,7 @@ SetLastError(ERROR_SUCCESS); RTEST(GetStockObject(0) != NULL); TEST(GetStockObject(20) != NULL); - TEST(GetStockObject(21) != NULL); + RTEST(GetStockObject(21) != NULL); RTEST(GetStockObject(-1) == NULL); RTEST(GetStockObject(9) == NULL); RTEST(GetStockObject(22) == NULL); @@ -15,27 +15,27 @@ RTEST((UINT)GetStockObject(WHITE_BRUSH) && GDI_HANDLE_STOCK_MASK); /* Test for correct types */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 0 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(LTGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(GRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DKGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN); /* 6 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_PEN)) == GDI_OBJECT_TYPE_PEN); /* 7 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_PEN)) == GDI_OBJECT_TYPE_PEN); /* 8 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(OEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 10 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 11 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 0 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(LTGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(GRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DKGRAY_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 1 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN); /* 6 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(BLACK_PEN)) == GDI_OBJECT_TYPE_PEN); /* 7 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(NULL_PEN)) == GDI_OBJECT_TYPE_PEN); /* 8 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(OEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 10 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 11 */ TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_VAR_FONT)) == GDI_OBJECT_TYPE_FONT); /* 12 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FONT)) == GDI_OBJECT_TYPE_FONT); /* 13 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEVICE_DEFAULT_FONT)) == GDI_OBJECT_TYPE_FONT); /* 14 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE); /* 15 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 16 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_GUI_FONT)) == GDI_OBJECT_TYPE_FONT); /* 17 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 18 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN); /* 19 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FONT)) == GDI_OBJECT_TYPE_FONT); /* 13 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEVICE_DEFAULT_FONT)) == GDI_OBJECT_TYPE_FONT); /* 14 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE); /* 15 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(SYSTEM_FIXED_FONT)) == GDI_OBJECT_TYPE_FONT); /* 16 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_GUI_FONT)) == GDI_OBJECT_TYPE_FONT); /* 17 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH); /* 18 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN); /* 19 */ TEST(GDI_HANDLE_GET_TYPE(GetStockObject(20)) == GDI_OBJECT_TYPE_COLORSPACE); /* 20 */ - TEST(GDI_HANDLE_GET_TYPE(GetStockObject(21)) == GDI_OBJECT_TYPE_BITMAP); /* 21 */ + RTEST(GDI_HANDLE_GET_TYPE(GetStockObject(21)) == GDI_OBJECT_TYPE_BITMAP); /* 21 */ return APISTATUS_NORMAL; } Modified: trunk/rostests/apitests/gdi32api/tests/SelectObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/S…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/SelectObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/SelectObject.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -23,16 +23,16 @@ SetLastError(ERROR_SUCCESS); hNewObj = GetStockObject(GRAY_BRUSH); hOldObj = SelectObject((HDC)GDI_HANDLE_GET_INDEX(hDC), hNewObj); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - TEST(hOldObj == NULL); - TEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH)); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + RTEST(hOldObj == NULL); + RTEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH)); SelectObject(hDC, hOldObj); /* Test incomplete hobj handle works */ hNewObj = GetStockObject(GRAY_BRUSH); hOldObj = SelectObject(hDC, (HGDIOBJ)GDI_HANDLE_GET_INDEX(hNewObj)); - TEST(hOldObj == GetStockObject(WHITE_BRUSH)); - TEST(pDc_Attr->hbrush == hNewObj); + RTEST(hOldObj == GetStockObject(WHITE_BRUSH)); + RTEST(pDc_Attr->hbrush == hNewObj); SelectObject(hDC, hOldObj); /* Test wrong hDC handle type */ @@ -41,9 +41,9 @@ hDC2 = (HDC)((UINT_PTR)hDC & ~GDI_HANDLE_TYPE_MASK); hDC2 = (HDC)((UINT_PTR)hDC2 | GDI_OBJECT_TYPE_PEN); hOldObj = SelectObject(hDC2, hNewObj); - TEST(GetLastError() == ERROR_INVALID_HANDLE); - TEST(hOldObj == NULL); - TEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH)); + RTEST(GetLastError() == ERROR_INVALID_HANDLE); + RTEST(hOldObj == NULL); + RTEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH)); /* Test wrong hobj handle type */ SetLastError(ERROR_SUCCESS); @@ -51,46 +51,46 @@ hNewObj = (HGDIOBJ)((UINT_PTR)hNewObj & ~GDI_HANDLE_TYPE_MASK); hNewObj = (HGDIOBJ)((UINT_PTR)hNewObj | GDI_OBJECT_TYPE_PEN); hOldObj = SelectObject(hDC, hNewObj); - TEST(GetLastError() == ERROR_SUCCESS); - TEST(hOldObj == NULL); - TEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH)); + RTEST(GetLastError() == ERROR_SUCCESS); + RTEST(hOldObj == NULL); + RTEST(pDc_Attr->hbrush == GetStockObject(WHITE_BRUSH)); SetLastError(ERROR_SUCCESS); hNewObj = (HGDIOBJ)0x00761234; hOldObj = SelectObject(hDC, hNewObj); - TEST(hOldObj == NULL); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(hOldObj == NULL); + RTEST(GetLastError() == ERROR_SUCCESS); SelectObject(hDC, hOldObj); /* Test DC */ SetLastError(ERROR_SUCCESS); hOldObj = SelectObject(hDC, hScreenDC); - TEST(hOldObj == NULL); + RTEST(hOldObj == NULL); TEST(GetLastError() == ERROR_SUCCESS); /* Test REGION */ SetLastError(ERROR_SUCCESS); hNewObj = CreateRectRgn(0,0,0,0); hOldObj = SelectObject(hDC, hNewObj); - TEST((UINT_PTR)hOldObj == NULLREGION); + RTEST((UINT_PTR)hOldObj == NULLREGION); DeleteObject(hNewObj); hNewObj = CreateRectRgn(0,0,10,10); - TEST((UINT_PTR)SelectObject(hDC, hNewObj) == SIMPLEREGION); + RTEST((UINT_PTR)SelectObject(hDC, hNewObj) == SIMPLEREGION); hOldObj = CreateRectRgn(5,5,20,20); - TEST(CombineRgn(hNewObj, hNewObj, hOldObj, RGN_OR) == COMPLEXREGION); + RTEST(CombineRgn(hNewObj, hNewObj, hOldObj, RGN_OR) == COMPLEXREGION); DeleteObject(hOldObj); - TEST((UINT_PTR)SelectObject(hDC, hNewObj) == SIMPLEREGION); // ??? Why this? + RTEST((UINT_PTR)SelectObject(hDC, hNewObj) == SIMPLEREGION); // ??? Why this? DeleteObject(hNewObj); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(GetLastError() == ERROR_SUCCESS); /* Test BITMAP */ hNewObj = CreateBitmap(2, 2, 1, 1, &bmBits); ASSERT(hNewObj != NULL); hOldObj = SelectObject(hDC, hNewObj); - TEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BITMAP); + RTEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BITMAP); hOldObj = SelectObject(hDC, hOldObj); - TEST(hOldObj == hNewObj); + RTEST(hOldObj == hNewObj); /* Test CLIOBJ */ @@ -100,8 +100,8 @@ SetLastError(ERROR_SUCCESS); hNewObj = GetStockObject(DEFAULT_PALETTE); hOldObj = SelectObject(hDC, hNewObj); - TEST(hOldObj == NULL); - TEST(GetLastError() == ERROR_INVALID_FUNCTION); + RTEST(hOldObj == NULL); + RTEST(GetLastError() == ERROR_INVALID_FUNCTION); /* Test COLORSPACE */ @@ -112,15 +112,15 @@ /* Test BRUSH */ hNewObj = GetStockObject(GRAY_BRUSH); hOldObj = SelectObject(hDC, hNewObj); - TEST(hOldObj == GetStockObject(WHITE_BRUSH)); - TEST(pDc_Attr->hbrush == hNewObj); - TEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BRUSH); + RTEST(hOldObj == GetStockObject(WHITE_BRUSH)); + RTEST(pDc_Attr->hbrush == hNewObj); + RTEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BRUSH); SelectObject(hDC, hOldObj); /* Test DC_BRUSH */ hNewObj = GetStockObject(DC_BRUSH); hOldObj = SelectObject(hDC, hNewObj); - TEST(pDc_Attr->hbrush == hNewObj); + RTEST(pDc_Attr->hbrush == hNewObj); SelectObject(hDC, hOldObj); /* Test BRUSH color xform */ @@ -136,9 +136,9 @@ /* Test PEN */ hNewObj = GetStockObject(GRAY_BRUSH); hOldObj = SelectObject(hDC, hNewObj); - TEST(hOldObj == GetStockObject(WHITE_BRUSH)); - TEST(pDc_Attr->hbrush == hNewObj); - TEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BRUSH); + RTEST(hOldObj == GetStockObject(WHITE_BRUSH)); + RTEST(pDc_Attr->hbrush == hNewObj); + RTEST(GDI_HANDLE_GET_TYPE(hOldObj) == GDI_OBJECT_TYPE_BRUSH); SelectObject(hDC, hOldObj); Modified: trunk/rostests/apitests/gdi32api/tests/SetDCPenColor.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/S…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/SetDCPenColor.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/SetDCPenColor.c [iso-8859-1] Mon Jun 16 10:24:05 2008 @@ -6,7 +6,7 @@ // Test an incorrect DC SetLastError(ERROR_SUCCESS); RTEST(SetDCPenColor(0, RGB(0,0,0)) == CLR_INVALID); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + RTEST(GetLastError() == ERROR_INVALID_PARAMETER); // Get the Screen DC hScreenDC = GetDC(NULL); @@ -14,23 +14,20 @@ // Test the screen DC SetDCPenColor(hScreenDC, RGB(1,2,3)); - TEST(SetDCPenColor(hScreenDC, RGB(4,5,6)) == RGB(1,2,3)); + RTEST(SetDCPenColor(hScreenDC, RGB(4,5,6)) == RGB(1,2,3)); // Create a new DC hDC = CreateCompatibleDC(hScreenDC); ReleaseDC(0, hScreenDC); - if (hDC == NULL) - { - return FALSE; - } + ASSERT(hDC); // Select the DC_PEN and check if the pen returned by a new call is DC_PEN SelectObject(hDC, GetStockObject(DC_PEN)); - TEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN)); + RTEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN)); // Test an incorrect color, yes windows sets the color! SetDCPenColor(hDC, 0x21123456); - TEST(SetDCPenColor(hDC, RGB(0,0,0)) == 0x21123456); + RTEST(SetDCPenColor(hDC, RGB(0,0,0)) == 0x21123456); // Test CLR_INVALID, it sets CLR_INVALID! SetDCPenColor(hDC, CLR_INVALID);
16 years, 6 months
1
0
0
0
[tkreuzer] 33993: TEST -> RTEST as these succeed on ros now
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 16 08:27:39 2008 New Revision: 33993 URL:
http://svn.reactos.org/svn/reactos?rev=33993&view=rev
Log: TEST -> RTEST as these succeed on ros now Modified: trunk/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c Modified: trunk/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/C…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c [iso-8859-1] Mon Jun 16 08:27:39 2008 @@ -10,26 +10,26 @@ /* Test NULL DC handle */ SetLastError(ERROR_SUCCESS); hDC = CreateCompatibleDC(NULL); - TEST(hDC != NULL); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(hDC != NULL); + RTEST(GetLastError() == ERROR_SUCCESS); if(hDC) DeleteDC(hDC); /* Test invalid DC handle */ SetLastError(ERROR_SUCCESS); hDC = CreateCompatibleDC((HDC)0x123456); - TEST(hDC == NULL); - TEST(GetLastError() == ERROR_SUCCESS); + RTEST(hDC == NULL); + RTEST(GetLastError() == ERROR_SUCCESS); if(hDC) DeleteDC(hDC); hDC = CreateCompatibleDC(hDCScreen); RTEST(hDC != NULL); // Test if first selected pen is BLACK_PEN (? or same as screen DC's pen?) - TEST(SelectObject(hDC, GetStockObject(DC_PEN)) == GetStockObject(BLACK_PEN)); - TEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN)); + RTEST(SelectObject(hDC, GetStockObject(DC_PEN)) == GetStockObject(BLACK_PEN)); + RTEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN)); // Test for the starting Color == RGB(0,0,0) - TEST(SetDCPenColor(hDC, RGB(1,2,3)) == RGB(0,0,0)); + RTEST(SetDCPenColor(hDC, RGB(1,2,3)) == RGB(0,0,0)); // Check for reuse counter hOldDC = hDC;
16 years, 6 months
1
0
0
0
[tkreuzer] 33992: comment out some tests that fail on win XP, until someone fixes them
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 16 08:20:06 2008 New Revision: 33992 URL:
http://svn.reactos.org/svn/reactos?rev=33992&view=rev
Log: comment out some tests that fail on win XP, until someone fixes them Modified: trunk/rostests/apitests/gdi32api/tests/EngAcquireSemaphore.c trunk/rostests/apitests/gdi32api/tests/EngDeleteSemaphore.c trunk/rostests/apitests/gdi32api/tests/EngReleaseSemaphore.c Modified: trunk/rostests/apitests/gdi32api/tests/EngAcquireSemaphore.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/E…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/EngAcquireSemaphore.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/EngAcquireSemaphore.c [iso-8859-1] Mon Jun 16 08:20:06 2008 @@ -13,7 +13,7 @@ /* real data test */ EngAcquireSemaphore(hsem); - RTEST (lpcrit->LockCount == -2); +// RTEST (lpcrit->LockCount == -2); doesn't work on XP RTEST (lpcrit->RecursionCount == 1); RTEST (lpcrit->OwningThread != 0); RTEST (lpcrit->LockSemaphore == 0); Modified: trunk/rostests/apitests/gdi32api/tests/EngDeleteSemaphore.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/E…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/EngDeleteSemaphore.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/EngDeleteSemaphore.c [iso-8859-1] Mon Jun 16 08:20:06 2008 @@ -12,13 +12,13 @@ lpcrit = (PRTL_CRITICAL_SECTION) hsem; EngDeleteSemaphore(hsem); - RTEST (lpcrit->LockCount > 0); +// RTEST (lpcrit->LockCount > 0); doesn't work on XP RTEST (lpcrit->RecursionCount == 0); RTEST (lpcrit->OwningThread == 0); RTEST (lpcrit->LockSemaphore == 0); RTEST (lpcrit->SpinCount == 0); - ASSERT(lpcrit->DebugInfo != NULL); +// ASSERT(lpcrit->DebugInfo != NULL); doesn't work on XP RTEST (lpcrit->DebugInfo->Type != 0); RTEST (lpcrit->DebugInfo->CreatorBackTraceIndex != 0); RTEST (lpcrit->DebugInfo->EntryCount != 0); Modified: trunk/rostests/apitests/gdi32api/tests/EngReleaseSemaphore.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/E…
============================================================================== --- trunk/rostests/apitests/gdi32api/tests/EngReleaseSemaphore.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32api/tests/EngReleaseSemaphore.c [iso-8859-1] Mon Jun 16 08:20:06 2008 @@ -30,17 +30,17 @@ /* try with deleted Semaphore */ EngReleaseSemaphore(hsem); - RTEST (lpcrit->LockCount > 0); +// RTEST (lpcrit->LockCount > 0); RTEST (lpcrit->RecursionCount != 0); RTEST (lpcrit->OwningThread == 0); RTEST (lpcrit->LockSemaphore == 0); RTEST (lpcrit->SpinCount == 0); - ASSERT(lpcrit->DebugInfo != NULL); - RTEST (lpcrit->DebugInfo->Type != 0); - RTEST (lpcrit->DebugInfo->CreatorBackTraceIndex != 0); - RTEST (lpcrit->DebugInfo->EntryCount != 0); - RTEST (lpcrit->DebugInfo->ContentionCount != 0); +// ASSERT(lpcrit->DebugInfo != NULL); +// RTEST (lpcrit->DebugInfo->Type != 0); +// RTEST (lpcrit->DebugInfo->CreatorBackTraceIndex != 0); +// RTEST (lpcrit->DebugInfo->EntryCount != 0); +// RTEST (lpcrit->DebugInfo->ContentionCount != 0); /* NULL pointer test */ // Note NULL pointer test crash in Vista */
16 years, 6 months
1
0
0
0
[fireball] 33991: - Revert .spec -> .def conversion (incorrect one also, which broke rostests compile).
by fireball@svn.reactos.org
Author: fireball Date: Mon Jun 16 07:22:13 2008 New Revision: 33991 URL:
http://svn.reactos.org/svn/reactos?rev=33991&view=rev
Log: - Revert .spec -> .def conversion (incorrect one also, which broke rostests compile). Added: trunk/reactos/dll/win32/powrprof/powrprof.spec - copied unchanged from r33985, trunk/reactos/dll/win32/powrprof/powrprof.spec Removed: trunk/reactos/dll/win32/powrprof/powrprof.def Modified: trunk/reactos/dll/win32/powrprof/powrprof.rbuild Removed: trunk/reactos/dll/win32/powrprof/powrprof.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/powrprof/powrpro…
============================================================================== --- trunk/reactos/dll/win32/powrprof/powrprof.def [iso-8859-1] (original) +++ trunk/reactos/dll/win32/powrprof/powrprof.def (removed) @@ -1,23 +1,0 @@ -LIBRARY powrprof.dll -EXPORTS -CallNtPowerInformation@20 -CanUserWritePwrScheme@0 -DeletePwrScheme@4 -EnumPwrSchemes@8 -GetActivePwrScheme@4 -GetCurrentPowerPolicies@8 -GetPwrCapabilities@4 -GetPwrDiskSpindownRange -IsAdminOverrideActive -IsPwrHibernateAllowed -IsPwrShutdownAllowed -IsPwrSuspendAllowed -ReadGlobalPwrPolicy@4 -ReadProcessorPwrScheme -ReadPwrScheme@8 -SetActivePwrScheme@12 -SetSuspendState -WriteGlobalPwrPolicy@4 -WriteProcessorPwrScheme -WritePwrScheme -ValidatePowerPolicies@8 Modified: trunk/reactos/dll/win32/powrprof/powrprof.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/powrprof/powrpro…
============================================================================== --- trunk/reactos/dll/win32/powrprof/powrprof.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/powrprof/powrprof.rbuild [iso-8859-1] Mon Jun 16 07:22:13 2008 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <module name="powrprof" type="win32dll" baseaddress="${BASEADDRESS_POWRPROF}" installbase="system32" installname="powrprof.dll" unicode="yes"> - <importlibrary definition="powrprof.def" /> + <importlibrary definition="powrprof.spec.def" /> <include base="powrprof">.</include> <define name="WINVER">0x600</define> <define name="_WIN32_WINNT">0x600</define> @@ -13,4 +13,5 @@ <library>comctl32</library> <file>powrprof.c</file> <file>powrprof.rc</file> + <file>powrprof.spec</file> </module>
16 years, 6 months
1
0
0
0
[fireball] 33990: - More NDK fixes. - Hackmove: Define NTDDI_VERSION in kernel32, otherwise it gets derived from WINVER version (and thus kernel32 becomes Vista). This allows to remove #undef NTDDI_VERSION from ndk/obtypes.h.
by fireball@svn.reactos.org
Author: fireball Date: Mon Jun 16 04:20:47 2008 New Revision: 33990 URL:
http://svn.reactos.org/svn/reactos?rev=33990&view=rev
Log: - More NDK fixes. - Hackmove: Define NTDDI_VERSION in kernel32, otherwise it gets derived from WINVER version (and thus kernel32 becomes Vista). This allows to remove #undef NTDDI_VERSION from ndk/obtypes.h. Modified: trunk/reactos/dll/win32/gdi32/objects/brush.c trunk/reactos/dll/win32/gdi32/objects/dc.c trunk/reactos/dll/win32/gdi32/objects/font.c trunk/reactos/dll/win32/gdi32/objects/text.c trunk/reactos/dll/win32/kernel32/kernel32.rbuild trunk/reactos/include/ndk/exfuncs.h trunk/reactos/include/ndk/extypes.h trunk/reactos/include/ndk/obtypes.h trunk/reactos/include/ndk/psfuncs.h trunk/reactos/include/ndk/pstypes.h trunk/reactos/include/ndk/umtypes.h Modified: trunk/reactos/dll/win32/gdi32/objects/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/br…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/brush.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/brush.c [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -317,7 +317,7 @@ #endif if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; - if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG) hdc) + if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY) { @@ -390,7 +390,7 @@ if ((nXOrg == Dc_Attr->ptlBrushOrigin.x) && (nYOrg == Dc_Attr->ptlBrushOrigin.y)) return TRUE; - if(((pTeb->GdiTebBatch.HDC == 0) || (pTeb->GdiTebBatch.HDC == (ULONG)hdc)) && + if(((pTeb->GdiTebBatch.HDC == NULL) || (pTeb->GdiTebBatch.HDC == hdc)) && ((pTeb->GdiTebBatch.Offset + sizeof(GDIBSSETBRHORG)) <= GDIBATCHBUFSIZE) && (!(Dc_Attr->ulDirty_ & DC_DIBSECTION)) ) { @@ -405,7 +405,7 @@ pgSBO->ptlBrushOrigin = Dc_Attr->ptlBrushOrigin; pTeb->GdiTebBatch.Offset += sizeof(GDIBSSETBRHORG); - pTeb->GdiTebBatch.HDC = (ULONG)hdc; + pTeb->GdiTebBatch.HDC = hdc; pTeb->GdiBatchCount++; DPRINT("Loading the Flush!! COUNT-> %d\n", pTeb->GdiBatchCount); @@ -420,4 +420,3 @@ } return NtGdiSetBrushOrg(hdc,nXOrg,nYOrg,lppt); } - Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/dc.c [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -994,7 +994,7 @@ #endif if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; - if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc) + if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY) { @@ -1041,7 +1041,7 @@ if (iMode == Dc_Attr->iGraphicsMode) return iMode; - if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc) + if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { if (Dc_Attr->ulDirty_ & DC_MODE_DIRTY) { @@ -1444,6 +1444,3 @@ return NULL; } - - - Modified: trunk/reactos/dll/win32/gdi32/objects/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/fo…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -1714,7 +1714,7 @@ #endif if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return GDI_ERROR; - if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hDC) + if (NtCurrentTeb()->GdiTebBatch.HDC == hDC) { if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY) { Modified: trunk/reactos/dll/win32/gdi32/objects/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/text.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/text.c [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -472,7 +472,7 @@ #endif if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return cExtra; - if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hDC) + if (NtCurrentTeb()->GdiTebBatch.HDC == hDC) { if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY) { @@ -629,7 +629,7 @@ #endif if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return FALSE; - if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hdc) + if (NtCurrentTeb()->GdiTebBatch.HDC == hdc) { if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY) { @@ -641,5 +641,3 @@ Dc_Attr->lBreakExtra = extra; return TRUE; } - - Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.rbuild [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -9,6 +9,7 @@ <define name="_WIN32_WINNT">0x0600</define> <define name="__NO_CTYPE_INLINES" /> <define name="WINVER">0x609</define> + <define name="NTDDI_VERSION">0x05020100</define> <dependency>errcodes</dependency> <pch>k32.h</pch> <directory name="debug"> Modified: trunk/reactos/include/ndk/exfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/exfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/exfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/exfuncs.h [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -25,6 +25,10 @@ #include <umtypes.h> #include <pstypes.h> #include <extypes.h> + +#ifdef __cplusplus +extern "C" { +#endif // // Don't include WMI headers just for one define @@ -1017,4 +1021,9 @@ IN ULONG TraceHeaderLength, IN PEVENT_TRACE_HEADER TraceHeader ); + +#ifdef __cplusplus +} #endif + +#endif Modified: trunk/reactos/include/ndk/extypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/extypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/extypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/extypes.h [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -855,24 +855,24 @@ HANDLE InheritedFromUniqueProcessId; ULONG HandleCount; ULONG SessionId; - ULONG UniqueProcessKey; + ULONG_PTR PageDirectoryBase; // // This part corresponds to VM_COUNTERS_EX. // NOTE: *NOT* THE SAME AS VM_COUNTERS! // - ULONG PeakVirtualSize; + SIZE_T PeakVirtualSize; ULONG VirtualSize; - ULONG PageFaultCount; - ULONG PeakWorkingSetSize; - ULONG WorkingSetSize; - ULONG QuotaPeakPagedPoolUsage; - ULONG QuotaPagedPoolUsage; - ULONG QuotaPeakNonPagedPoolUsage; - ULONG QuotaNonPagedPoolUsage; - ULONG PagefileUsage; - ULONG PeakPagefileUsage; - ULONG PrivatePageCount; + SIZE_T PageFaultCount; + SIZE_T PeakWorkingSetSize; + SIZE_T WorkingSetSize; + SIZE_T QuotaPeakPagedPoolUsage; + SIZE_T QuotaPagedPoolUsage; + SIZE_T QuotaPeakNonPagedPoolUsage; + SIZE_T QuotaNonPagedPoolUsage; + SIZE_T PagefileUsage; + SIZE_T PeakPagefileUsage; + SIZE_T PrivatePageCount; // // This part corresponds to IO_COUNTERS Modified: trunk/reactos/include/ndk/obtypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/obtypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/obtypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/obtypes.h [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -18,9 +18,6 @@ #ifndef _OBTYPES_H #define _OBTYPES_H - -#undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WS03SP1 // // Dependencies @@ -299,6 +296,12 @@ ULONG DefaultNonPagedPoolCharge; } OBJECT_TYPE_INFORMATION, *POBJECT_TYPE_INFORMATION; +typedef struct _OBJECT_ALL_TYPES_INFORMATION +{ + ULONG NumberOfTypes; + //OBJECT_TYPE_INFORMATION TypeInformation[1]; +} OBJECT_ALL_TYPES_INFORMATION, *POBJECT_ALL_TYPES_INFORMATION; + #ifdef NTOS_MODE_USER typedef struct _OBJECT_BASIC_INFORMATION Modified: trunk/reactos/include/ndk/psfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/psfuncs.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/psfuncs.h [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -24,6 +24,10 @@ // #include <umtypes.h> #include <pstypes.h> + +#ifdef __cplusplus +extern "C" { +#endif #ifndef NTOS_MODE_USER @@ -744,4 +748,8 @@ NTSTATUS ExitStatus ); -#endif +#ifdef __cplusplus +} +#endif + +#endif Modified: trunk/reactos/include/ndk/pstypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/pstypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/pstypes.h [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -293,6 +293,12 @@ ProcessCycleTime, ProcessPagePriority, ProcessInstrumentationCallback, + ProcessThreadStackAllocation, + ProcessWorkingSetWatchEx, + ProcessImageFileNameWin32, + ProcessImageFileMapping, + ProcessAffinityUpdateMode, + ProcessMemoryAllocationMode, MaxProcessInfoClass } PROCESSINFOCLASS; @@ -680,7 +686,7 @@ typedef struct _GDI_TEB_BATCH { ULONG Offset; - ULONG HDC; + HANDLE HDC; ULONG Buffer[0x136]; } GDI_TEB_BATCH, *PGDI_TEB_BATCH; @@ -735,7 +741,11 @@ PVOID SystemReserved1[0x36]; LONG ExceptionCode; struct _ACTIVATION_CONTEXT_STACK *ActivationContextStackPointer; +#ifdef _WIN64 + UCHAR SpareBytes1[24]; +#else UCHAR SpareBytes1[0x24]; +#endif ULONG TxFsContext; GDI_TEB_BATCH GdiTebBatch; CLIENT_ID RealClientId; @@ -743,9 +753,9 @@ ULONG GdiClientPID; ULONG GdiClientTID; PVOID GdiThreadLocalInfo; - ULONG Win32ClientInfo[62]; + SIZE_T Win32ClientInfo[62]; PVOID glDispatchTable[0xE9]; - ULONG glReserved1[0x1D]; + SIZE_T glReserved1[0x1D]; PVOID glReserved2; PVOID glSectionInfo; PVOID glSection; @@ -762,10 +772,17 @@ PVOID ReservedForNtRpc; PVOID DbgSsReserved[0x2]; ULONG HardErrorDisabled; +#ifdef _WIN64 + PVOID Instrumentation[11]; +#else PVOID Instrumentation[9]; +#endif GUID ActivityId; PVOID SubProcessTag; PVOID EtwTraceData; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + PVOID EtwLocalData; +#endif PVOID WinSockData; ULONG GdiBatchCount; #if (NTDDI_VERSION >= NTDDI_LONGHORN) Modified: trunk/reactos/include/ndk/umtypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/umtypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/umtypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/umtypes.h [iso-8859-1] Mon Jun 16 04:20:47 2008 @@ -53,7 +53,9 @@ // #ifndef _MANAGED #if defined(_M_IX86) +#ifndef FASTCALL #define FASTCALL _fastcall +#endif #else #define FASTCALL #endif
16 years, 6 months
1
0
0
0
[fireball] 33989: - NDK fixes (structure rename only).
by fireball@svn.reactos.org
Author: fireball Date: Mon Jun 16 03:54:21 2008 New Revision: 33989 URL:
http://svn.reactos.org/svn/reactos?rev=33989&view=rev
Log: - NDK fixes (structure rename only). Modified: trunk/reactos/include/ndk/sefuncs.h trunk/reactos/include/ndk/setypes.h trunk/reactos/ntoskrnl/include/internal/ob.h trunk/reactos/ntoskrnl/include/internal/se.h trunk/reactos/ntoskrnl/ob/obhandle.c trunk/reactos/ntoskrnl/ob/obref.c trunk/reactos/ntoskrnl/ob/obsecure.c trunk/reactos/ntoskrnl/ps/process.c trunk/reactos/ntoskrnl/ps/thread.c trunk/reactos/ntoskrnl/se/access.c Modified: trunk/reactos/include/ndk/sefuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/sefuncs.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/sefuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/sefuncs.h [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -57,7 +57,7 @@ NTAPI SeCreateAccessState( PACCESS_STATE AccessState, - PAUX_DATA AuxData, + PAUX_ACCESS_DATA AuxData, ACCESS_MASK Access, PGENERIC_MAPPING GenericMapping ); Modified: trunk/reactos/include/ndk/setypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/setypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/setypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/setypes.h [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -160,12 +160,12 @@ ULONG VariablePart; /* 0xA0 */ } TOKEN, *PTOKEN; -typedef struct _AUX_DATA +typedef struct _AUX_ACCESS_DATA { PPRIVILEGE_SET PrivilegeSet; GENERIC_MAPPING GenericMapping; ULONG Reserved; -} AUX_DATA, *PAUX_DATA; +} AUX_ACCESS_DATA, *PAUX_ACCESS_DATA; // // External SRM Data Modified: trunk/reactos/ntoskrnl/include/internal/ob.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/ob.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/ob.h [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -154,7 +154,7 @@ ACCESS_STATE LocalAccessState; OBJECT_CREATE_INFORMATION ObjectCreateInfo; OBP_LOOKUP_CONTEXT LookupContext; - AUX_DATA AuxData; + AUX_ACCESS_DATA AuxData; } OB_TEMP_BUFFER, *POB_TEMP_BUFFER; // Modified: trunk/reactos/ntoskrnl/include/internal/se.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/se.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/se.h [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -139,7 +139,7 @@ IN PETHREAD Thread, IN PEPROCESS Process, IN OUT PACCESS_STATE AccessState, - IN PAUX_DATA AuxData, + IN PAUX_ACCESS_DATA AuxData, IN ACCESS_MASK Access, IN PGENERIC_MAPPING GenericMapping ); Modified: trunk/reactos/ntoskrnl/ob/obhandle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obhandle.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ob/obhandle.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ob/obhandle.c [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -1449,7 +1449,7 @@ PVOID HandleTable; NTSTATUS Status; ACCESS_MASK DesiredAccess, GrantedAccess; - PAUX_DATA AuxData; + PAUX_ACCESS_DATA AuxData; PAGED_CODE(); /* Get the object header and type */ @@ -2097,7 +2097,7 @@ ACCESS_MASK TargetAccess, SourceAccess; ACCESS_STATE AccessState; PACCESS_STATE PassedAccessState = NULL; - AUX_DATA AuxData; + AUX_ACCESS_DATA AuxData; PHANDLE_TABLE HandleTable; OBJECT_HANDLE_INFORMATION HandleInformation; ULONG AuditMask; @@ -2590,7 +2590,7 @@ POBJECT_HEADER Header; NTSTATUS Status; ACCESS_STATE AccessState; - AUX_DATA AuxData; + AUX_ACCESS_DATA AuxData; PAGED_CODE(); /* Assume failure */ @@ -2789,7 +2789,7 @@ POBJECT_HEADER_NAME_INFO ObjectNameInfo; OBP_LOOKUP_CONTEXT Context; ACCESS_STATE LocalAccessState; - AUX_DATA AuxData; + AUX_ACCESS_DATA AuxData; OB_OPEN_REASON OpenReason; KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS, RealStatus; Modified: trunk/reactos/ntoskrnl/ob/obref.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obref.c?rev=33…
============================================================================== --- trunk/reactos/ntoskrnl/ob/obref.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ob/obref.c [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -388,7 +388,7 @@ UNICODE_STRING ObjectName; NTSTATUS Status; OBP_LOOKUP_CONTEXT Context; - AUX_DATA AuxData; + AUX_ACCESS_DATA AuxData; ACCESS_STATE AccessState; PAGED_CODE(); Modified: trunk/reactos/ntoskrnl/ob/obsecure.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obsecure.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ob/obsecure.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ob/obsecure.c [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -352,7 +352,7 @@ &AccessState->SubjectSecurityContext, AccessState->RemainingDesiredAccess | AccessState->PreviouslyGrantedAccess, - ((PAUX_DATA)(AccessState->AuxData))-> + ((PAUX_ACCESS_DATA)(AccessState->AuxData))-> PrivilegeSet, Result, AccessMode); Modified: trunk/reactos/ntoskrnl/ps/process.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/process.c [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -374,7 +374,7 @@ ULONG MinWs, MaxWs; ACCESS_STATE LocalAccessState; PACCESS_STATE AccessState = &LocalAccessState; - AUX_DATA AuxData; + AUX_ACCESS_DATA AuxData; UCHAR Quantum; BOOLEAN Result, SdAllocated; PSECURITY_DESCRIPTOR SecurityDescriptor; @@ -1334,7 +1334,7 @@ PEPROCESS Process = NULL; NTSTATUS Status = STATUS_SUCCESS; ACCESS_STATE AccessState; - AUX_DATA AuxData; + AUX_ACCESS_DATA AuxData; PAGED_CODE(); PSTRACE(PS_PROCESS_DEBUG, "ClientId: %p Attributes: %p\n", ClientId, ObjectAttributes); Modified: trunk/reactos/ntoskrnl/ps/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/thread.c?rev=3…
============================================================================== --- trunk/reactos/ntoskrnl/ps/thread.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/thread.c [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -193,7 +193,7 @@ HANDLE_TABLE_ENTRY CidEntry; ACCESS_STATE LocalAccessState; PACCESS_STATE AccessState = &LocalAccessState; - AUX_DATA AuxData; + AUX_ACCESS_DATA AuxData; BOOLEAN Result, SdAllocated; PSECURITY_DESCRIPTOR SecurityDescriptor; SECURITY_SUBJECT_CONTEXT SubjectContext; @@ -952,7 +952,7 @@ PETHREAD Thread; BOOLEAN HasObjectName = FALSE; ACCESS_STATE AccessState; - AUX_DATA AuxData; + AUX_ACCESS_DATA AuxData; PAGED_CODE(); PSTRACE(PS_THREAD_DEBUG, "ClientId: %p ObjectAttributes: %p\n", ClientId, ObjectAttributes); Modified: trunk/reactos/ntoskrnl/se/access.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/access.c?rev=3…
============================================================================== --- trunk/reactos/ntoskrnl/se/access.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/access.c [iso-8859-1] Mon Jun 16 03:54:21 2008 @@ -121,7 +121,7 @@ SeCreateAccessStateEx(IN PETHREAD Thread, IN PEPROCESS Process, IN OUT PACCESS_STATE AccessState, - IN PAUX_DATA AuxData, + IN PAUX_ACCESS_DATA AuxData, IN ACCESS_MASK Access, IN PGENERIC_MAPPING GenericMapping) { @@ -177,7 +177,7 @@ NTSTATUS STDCALL SeCreateAccessState(IN OUT PACCESS_STATE AccessState, - IN PAUX_DATA AuxData, + IN PAUX_ACCESS_DATA AuxData, IN ACCESS_MASK Access, IN PGENERIC_MAPPING GenericMapping) { @@ -199,7 +199,7 @@ STDCALL SeDeleteAccessState(IN PACCESS_STATE AccessState) { - PAUX_DATA AuxData; + PAUX_ACCESS_DATA AuxData; PAGED_CODE(); /* Get the Auxiliary Data */ @@ -233,7 +233,7 @@ PAGED_CODE(); /* Set the Generic Mapping */ - ((PAUX_DATA)AccessState->AuxData)->GenericMapping = *GenericMapping; + ((PAUX_ACCESS_DATA)AccessState->AuxData)->GenericMapping = *GenericMapping; } /*
16 years, 6 months
1
0
0
0
[dchapyshev] 33988: - Small fix DeletePwrScheme - Implement ReadGlobalPwrPolicy - Implement ReadPwrScheme - Implement ValidatePowerPolicies (not fully implemented)
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Mon Jun 16 03:20:21 2008 New Revision: 33988 URL:
http://svn.reactos.org/svn/reactos?rev=33988&view=rev
Log: - Small fix DeletePwrScheme - Implement ReadGlobalPwrPolicy - Implement ReadPwrScheme - Implement ValidatePowerPolicies (not fully implemented) Modified: trunk/reactos/dll/win32/powrprof/powrprof.c Modified: trunk/reactos/dll/win32/powrprof/powrprof.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/powrprof/powrpro…
============================================================================== --- trunk/reactos/dll/win32/powrprof/powrprof.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/powrprof/powrprof.c [iso-8859-1] Mon Jun 16 03:20:21 2008 @@ -87,7 +87,7 @@ UINT Current; LONG Err; - swprintf(Buf, L"Control Panel\\PowerCfg\\PowerPolicies\\%u", uiIndex); + swprintf(Buf, L"Control Panel\\PowerCfg\\PowerPolicies\\%d", uiIndex); if (GetActivePwrScheme(&Current)) { @@ -118,16 +118,19 @@ static BOOLEAN -POWRPROF_GetUserPowerPolicy(HKEY hKey, LPWSTR szNum, +POWRPROF_GetUserPowerPolicy(LPWSTR szNum, USER_POWER_POLICY userPwrPolicy, - DWORD *dwName, LPWSTR szName, - DWORD *dwDesc, LPWSTR szDesc) + DWORD dwName, LPWSTR szName, + DWORD dwDesc, LPWSTR szDesc) { HKEY hSubKey; DWORD dwSize; LONG Err; - - Err = RegOpenKeyW(hKey, szNum, &hSubKey); + WCHAR szPath[MAX_PATH]; + + swprintf(szPath, L"Control Panel\\PowerCfg\\PowerPolicies\\%s", szNum); + + Err = RegOpenKeyW(HKEY_CURRENT_USER, szPath, &hSubKey); if (Err != ERROR_SUCCESS) { ERR("RegOpenKeyW failed: %d\n", Err); @@ -135,8 +138,8 @@ return FALSE; } - *dwName = MAX_PATH * sizeof(WCHAR); - Err = RegQueryValueExW(hSubKey, L"Name", NULL, NULL, (LPBYTE)szName, dwName); + dwName = MAX_PATH * sizeof(WCHAR); + Err = RegQueryValueExW(hSubKey, L"Name", NULL, NULL, (LPBYTE)szName, &dwName); if (Err != ERROR_SUCCESS) { ERR("RegQueryValueExW failed: %d\n", Err); @@ -144,8 +147,8 @@ return FALSE; } - *dwDesc = MAX_PATH * sizeof(WCHAR); - Err = RegQueryValueExW(hSubKey, L"Description", NULL, NULL, (LPBYTE)szDesc, dwDesc); + dwDesc = MAX_PATH * sizeof(WCHAR); + Err = RegQueryValueExW(hSubKey, L"Description", NULL, NULL, (LPBYTE)szDesc, &dwDesc); if (Err != ERROR_SUCCESS) { ERR("RegQueryValueExW failed: %d\n", Err); @@ -153,7 +156,7 @@ return FALSE; } - dwSize = sizeof(USER_POWER_POLICY); + dwSize = sizeof(userPwrPolicy); Err = RegQueryValueExW(hSubKey, L"Policies", NULL, NULL, (LPBYTE)&userPwrPolicy, &dwSize); if (Err != ERROR_SUCCESS) { @@ -183,7 +186,7 @@ return FALSE; } - dwSize = sizeof(MACHINE_POWER_POLICY); + dwSize = sizeof(machinePwrPolicy); Err = RegQueryValueExW(hKey, L"Policies", NULL, NULL, (LPBYTE)&machinePwrPolicy, &dwSize); if (Err != ERROR_SUCCESS) { @@ -201,9 +204,9 @@ { HKEY hKey; LONG Err; - DWORD dwSize, dwNameSize, dwDescSize, dwIndex = 0; + DWORD dwSize, dwNameSize = 0, dwDescSize = 0, dwIndex = 0; WCHAR szNum[3 + 1], szName[MAX_PATH], szDesc[MAX_PATH]; - PPOWER_POLICY pPwrPolicy; + PPOWER_POLICY pPwrPolicy = NULL; USER_POWER_POLICY userPwrPolicy; MACHINE_POWER_POLICY machinePwrPolicy; @@ -227,9 +230,9 @@ while (RegEnumKeyExW(hKey, dwIndex, szNum, &dwSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { - if (!POWRPROF_GetUserPowerPolicy(hKey, szNum, userPwrPolicy, - &dwNameSize, szName, - &dwDescSize, szDesc)) + if (!POWRPROF_GetUserPowerPolicy(szNum, userPwrPolicy, + dwNameSize, szName, + dwDescSize, szDesc)) { RegCloseKey(hKey); ReleaseSemaphore(PPRegSemaphore, 1, NULL); @@ -243,9 +246,8 @@ return FALSE; } - ZeroMemory(&pPwrPolicy, sizeof(PPOWER_POLICY)); - pPwrPolicy->user = userPwrPolicy; - pPwrPolicy->mach = machinePwrPolicy; + memcpy(&pPwrPolicy->user, &userPwrPolicy, sizeof(USER_POWER_POLICY)); + memcpy(&pPwrPolicy->mach, &machinePwrPolicy, sizeof(MACHINE_POWER_POLICY)); if (!lpfnPwrSchemesEnumProc(_wtoi(szNum), dwNameSize, szName, dwDescSize, szDesc, pPwrPolicy, lParam)) break; @@ -446,9 +448,65 @@ BOOLEAN WINAPI ReadGlobalPwrPolicy(PGLOBAL_POWER_POLICY pGlobalPowerPolicy) { - FIXME("(%p) stub!\n", pGlobalPowerPolicy); - SetLastError(ERROR_FILE_NOT_FOUND); - return FALSE; + GLOBAL_MACHINE_POWER_POLICY glMachPwrPolicy; + GLOBAL_USER_POWER_POLICY glUserPwrPolicy; + HKEY hKey; + DWORD dwSize; + LONG Err; + + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + + // Getting user global power policy + Err = RegOpenKeyW(HKEY_CURRENT_USER, L"Control Panel\\PowerCfg\\GlobalPowerPolicy", &hKey); + if (Err != ERROR_SUCCESS) + { + ERR("RegOpenKeyW failed: %d\n", Err); + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + SetLastError(Err); + return FALSE; + } + + dwSize = sizeof(glUserPwrPolicy); + Err = RegQueryValueExW(hKey, L"Policies", NULL, NULL, (LPBYTE)&glUserPwrPolicy, &dwSize); + if (Err != ERROR_SUCCESS) + { + ERR("RegQueryValueExW failed: %d\n", Err); + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + SetLastError(Err); + return FALSE; + } + + RegCloseKey(hKey); + + // Getting machine global power policy + Err = RegOpenKeyW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Controls Folder\\PowerCfg\\GlobalPowerPolicy", &hKey); + if (Err != ERROR_SUCCESS) + { + ERR("RegOpenKeyW failed: %d\n", Err); + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + SetLastError(Err); + return FALSE; + } + + dwSize = sizeof(glMachPwrPolicy); + Err = RegQueryValueExW(hKey, L"Policies", NULL, NULL, (LPBYTE)&glMachPwrPolicy, &dwSize); + if (Err != ERROR_SUCCESS) + { + ERR("RegQueryValueExW failed: %d\n", Err); + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + SetLastError(Err); + return FALSE; + } + + RegCloseKey(hKey); + + memcpy(&pGlobalPowerPolicy->user, &glUserPwrPolicy, sizeof(GLOBAL_USER_POWER_POLICY)); + memcpy(&pGlobalPowerPolicy->mach, &glMachPwrPolicy, sizeof(GLOBAL_MACHINE_POWER_POLICY)); + + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + SetLastError(ERROR_SUCCESS); + + return TRUE; } @@ -466,9 +524,33 @@ ReadPwrScheme(UINT uiID, PPOWER_POLICY pPowerPolicy) { - FIXME("(%d, %p) stub!\n", uiID, pPowerPolicy); - SetLastError(ERROR_FILE_NOT_FOUND); - return FALSE; + USER_POWER_POLICY userPwrPolicy; + MACHINE_POWER_POLICY machinePwrPolicy; + WCHAR szNum[3 + 1]; // max number - 999 + + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + + swprintf(szNum, L"%d", uiID); + + if (!POWRPROF_GetUserPowerPolicy(szNum, userPwrPolicy, 0, NULL, 0, NULL)) + { + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + return FALSE; + } + + if (!POWRPROF_GetMachinePowerPolicy(szNum, machinePwrPolicy)) + { + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + return FALSE; + } + + memcpy(&pPowerPolicy->user, &userPwrPolicy, sizeof(USER_POWER_POLICY)); + memcpy(&pPowerPolicy->mach, &machinePwrPolicy, sizeof(MACHINE_POWER_POLICY)); + + ReleaseSemaphore(PPRegSemaphore, 1, NULL); + SetLastError(ERROR_SUCCESS); + + return TRUE; } @@ -527,8 +609,28 @@ BOOLEAN WINAPI ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP) { - FIXME("(%p, %p) stub!\n", pGPP, pPP); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + GLOBAL_POWER_POLICY pGlobalPowerPolicy; + POWER_POLICY pPowerPolicy; + + FIXME("(%p, %p) not fully implemented\n", pGPP, pPP); + + if (!GetCurrentPowerPolicies(&pGlobalPowerPolicy, &pPowerPolicy)) + { + ERR("GetCurrentPowerPolicies(%p, %p) failed\n", pGPP, pPP); + return FALSE; + } + + if (!pGPP) + { + memcpy(&pGPP, &pGlobalPowerPolicy, sizeof(GLOBAL_POWER_POLICY)); + } + + if (!pPP) + { + memcpy(&pPP, &pPowerPolicy, sizeof(POWER_POLICY)); + } + + SetLastError(ERROR_SUCCESS); return TRUE; }
16 years, 6 months
1
0
0
0
[dchapyshev] 33987: - Update information about powrprof
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Mon Jun 16 01:06:38 2008 New Revision: 33987 URL:
http://svn.reactos.org/svn/reactos?rev=33987&view=rev
Log: - Update information about powrprof Modified: trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Jun 16 01:06:38 2008 @@ -76,7 +76,7 @@ reactos/dll/win32/oledlg # Autosync reactos/dll/win32/olepro32 # Autosync reactos/dll/win32/pdh # Autosync -reactos/dll/win32/powrprof # Autosync +reactos/dll/win32/powrprof # Forked at Wine-1.0rc5 reactos/dll/win32/printui # Autosync reactos/dll/win32/rasapi32 # Autosync reactos/dll/win32/riched20 # Autosync
16 years, 6 months
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
...
44
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Results per page:
10
25
50
100
200