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
April 2012
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
11 participants
156 discussions
Start a n
N
ew thread
[tkreuzer] 56424: [GDI32] Fix SetWindowExtEx to pass all tests
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Apr 25 18:15:41 2012 New Revision: 56424 URL:
http://svn.reactos.org/svn/reactos?rev=56424&view=rev
Log: [GDI32] Fix SetWindowExtEx to pass all tests Modified: trunk/reactos/win32ss/gdi/gdi32/objects/coord.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/coord.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/coord.c [iso-8859-1] Wed Apr 25 18:15:41 2012 @@ -483,38 +483,42 @@ */ BOOL WINAPI -SetWindowExtEx(HDC hdc, - int nXExtent, - int nYExtent, - LPSIZE lpSize) +SetWindowExtEx( + _In_ HDC hdc, + _In_ INT nXExtent, + _In_ INT nYExtent, + _Out_opt_ LPSIZE lpSize) { PDC_ATTR pdcattr; - -#if 0 - if (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC) - { - if (GDI_HANDLE_GET_TYPE(hdc) == GDI_OBJECT_TYPE_METADC) - return MFDRV_SetWindowExtEx(); - else - { - PLDC pLDC = GdiGetLDC(hdc); - if ( !pLDC ) - { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - if (pLDC->iType == LDC_EMFLDC) - { - return EMFDRV_SetWindowExtEx(); - } - } - } -#endif + ULONG ulType; + + /* Check what type of DC that is */ + ulType = GDI_HANDLE_GET_TYPE(hdc); + switch (ulType) + { + case GDILoObjType_LO_DC_TYPE: + /* Handle this in the path below */ + break; +#if 0// FIXME: we don't support this + case GDILoObjType_LO_METADC16_TYPE: + return MFDRV_SetWindowExtEx(hdc, nXExtent, nYExtent, lpSize); + + case GDILoObjType_LO_METAFILE_TYPE: + return EMFDRV_SetWindowExtEx(hdc, nXExtent, nYExtent, lpSize); +#endif + default: + /* Other types are not allowed */ + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + /* Get the DC attr */ pdcattr = GdiGetDcAttr(hdc); if (!pdcattr) { + /* Set the error value and return failure */ SetLastError(ERROR_INVALID_PARAMETER); - return 0; + return FALSE; } if (lpSize) @@ -549,7 +553,8 @@ if (pdcattr->dwLayout & LAYOUT_RTL) NtGdiMirrorWindowOrg(hdc); pdcattr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID); } - return TRUE; // Return TRUE. + + return TRUE; } /*
12 years, 8 months
1
0
0
0
[tkreuzer] 56423: [GDI32_APITEST] Add more tests for SetWindowExtEx
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Apr 25 18:14:52 2012 New Revision: 56423 URL:
http://svn.reactos.org/svn/reactos?rev=56423&view=rev
Log: [GDI32_APITEST] Add more tests for SetWindowExtEx Modified: trunk/rostests/apitests/gdi32/SetWindowExtEx.c Modified: trunk/rostests/apitests/gdi32/SetWindowExtEx.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/SetWindowE…
============================================================================== --- trunk/rostests/apitests/gdi32/SetWindowExtEx.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/SetWindowExtEx.c [iso-8859-1] Wed Apr 25 18:14:52 2012 @@ -26,24 +26,55 @@ SetLastError(0); ret = SetWindowExtEx(0, 0, 0, NULL); - TEST(GetLastError() == ERROR_INVALID_HANDLE); + ok_err(ERROR_INVALID_HANDLE); TEST(ret == 0); SetLastError(0); ret = SetWindowExtEx((HDC)0x1234, 0, 0, NULL); - TEST(GetLastError() == ERROR_INVALID_HANDLE); + ok_err(ERROR_INVALID_HANDLE); + TEST(ret == 0); + + SetLastError(0); + ret = SetWindowExtEx((HDC)0x10000, 0, 0, NULL); + ok_err(ERROR_INVALID_PARAMETER); + TEST(ret == 0); + + SetLastError(0); + ret = SetWindowExtEx((HDC)0x210000, 0, 0, NULL); // GDILoObjType_LO_ALTDC_TYPE + ok_err(ERROR_INVALID_HANDLE); + TEST(ret == 0); + + SetLastError(0); + ret = SetWindowExtEx((HDC)0x260000, 0, 0, NULL); // GDILoObjType_LO_METAFILE16_TYPE + ok_err(ERROR_INVALID_HANDLE); + TEST(ret == 0); + + SetLastError(0); + ret = SetWindowExtEx((HDC)0x460000, 0, 0, NULL); // GDILoObjType_LO_METAFILE_TYPE + ok_err(ERROR_INVALID_HANDLE); + TEST(ret == 0); + + SetLastError(0); + ret = SetWindowExtEx((HDC)0x660000, 0, 0, NULL); // GDILoObjType_LO_METADC16_TYPE + ok_err(ERROR_INVALID_HANDLE); TEST(ret == 0); SetLastError(0); ret = SetWindowExtEx(hDC, 0, 0, NULL); - TEST(GetLastError() == 0); - TEST(ret == 1); + ok_err(0); + TEST(ret == 1); + + /* Test 16 bit handle */ + SetLastError(0); + ret = SetWindowExtEx((HDC)((ULONG_PTR)hDC & 0xffff), 0, 0, NULL); + ok_err(ERROR_INVALID_HANDLE); + TEST(ret == 0); WindowExt.cx = 1234; WindowExt.cy = 6789; SetLastError(0); ret = SetWindowExtEx(0, 0, 0, &WindowExt); - TEST(GetLastError() == ERROR_INVALID_HANDLE); + ok_err(ERROR_INVALID_HANDLE); TEST(ret == 0); TEST(WindowExt.cx == 1234); TEST(WindowExt.cy == 6789); @@ -53,7 +84,7 @@ /* Test with a deleted DC */ SetLastError(0); ret = SetWindowExtEx(hDC, 0, 0, NULL); - TEST(GetLastError() == ERROR_INVALID_PARAMETER); + ok_err(ERROR_INVALID_PARAMETER); TEST(ret == 0); hDC = CreateCompatibleDC(0);
12 years, 8 months
1
0
0
0
[tkreuzer] 56422: [WIN32K] - Make XFORMOBJ_iSetXform fail, when the XFORM is invalid (eM11 or eM22 are 0) - Handle error in GreModifyWorldTransform
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Apr 25 17:29:50 2012 New Revision: 56422 URL:
http://svn.reactos.org/svn/reactos?rev=56422&view=rev
Log: [WIN32K] - Make XFORMOBJ_iSetXform fail, when the XFORM is invalid (eM11 or eM22 are 0) - Handle error in GreModifyWorldTransform Modified: trunk/reactos/win32ss/gdi/ntgdi/coord.c trunk/reactos/win32ss/gdi/ntgdi/xformobj.c Modified: trunk/reactos/win32ss/gdi/ntgdi/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/coord.c?…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/coord.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/coord.c [iso-8859-1] Wed Apr 25 17:29:50 2012 @@ -461,20 +461,23 @@ case MWT_LEFTMULTIPLY: XFORMOBJ_vInit(&xoDC, &pdc->pdcattr->mxWorldToPage); XFORMOBJ_vInit(&xoSrc, &mxSrc); - XFORMOBJ_iSetXform(&xoSrc, pxform); + if (XFORMOBJ_iSetXform(&xoSrc, pxform) == DDI_ERROR) + return FALSE; XFORMOBJ_iCombine(&xoDC, &xoSrc, &xoDC); break; case MWT_RIGHTMULTIPLY: XFORMOBJ_vInit(&xoDC, &pdc->pdcattr->mxWorldToPage); XFORMOBJ_vInit(&xoSrc, &mxSrc); - XFORMOBJ_iSetXform(&xoSrc, pxform); + if (XFORMOBJ_iSetXform(&xoSrc, pxform) == DDI_ERROR) + return FALSE; XFORMOBJ_iCombine(&xoDC, &xoDC, &xoSrc); break; case MWT_MAX+1: // Must be MWT_SET???? XFORMOBJ_vInit(&xoDC, &pdc->pdcattr->mxWorldToPage); - XFORMOBJ_iSetXform(&xoDC, pxform); + if (XFORMOBJ_iSetXform(&xoDC, pxform) == DDI_ERROR) + return FALSE; break; default: Modified: trunk/reactos/win32ss/gdi/ntgdi/xformobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/xformobj…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/xformobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/xformobj.c [iso-8859-1] Wed Apr 25 17:29:50 2012 @@ -160,10 +160,10 @@ PMATRIX pmx = XFORMOBJ_pmx(pxo); /* Check parameters */ - if (!pxo || !pxform) - { - return DDI_ERROR; - } + if (!pxo || !pxform) return DDI_ERROR; + + /* Check if the xform is valid */ + if ((pxform->eM11 == 0) || (pxform->eM22 == 0)) return DDI_ERROR; /* Copy members */ FLOATOBJ_SetFloat(&pmx->efM11, pxform->eM11);
12 years, 8 months
1
0
0
0
[tkreuzer] 56421: [GDI32] Fix CombineTransform to pass all tests
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Apr 25 15:20:55 2012 New Revision: 56421 URL:
http://svn.reactos.org/svn/reactos?rev=56421&view=rev
Log: [GDI32] Fix CombineTransform to pass all tests Modified: trunk/reactos/win32ss/gdi/gdi32/objects/coord.c Modified: trunk/reactos/win32ss/gdi/gdi32/objects/coord.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
============================================================================== --- trunk/reactos/win32ss/gdi/gdi32/objects/coord.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/gdi32/objects/coord.c [iso-8859-1] Wed Apr 25 15:20:55 2012 @@ -56,7 +56,8 @@ GdiTransformPoints2(&xform, pptOut, pptIn, nCount); } -#define MAX_OFFSET 4294967040.0 +#define MAX_OFFSET 4294967041.0 +#define _fmul(x,y) (((x) == 0) ? 0 : (x) * (y)) BOOL WINAPI @@ -70,31 +71,39 @@ /* Check paramters */ if (!pxfResult || !pxf1 || !pxf2) return FALSE; - /* Do matrix multiplication */ - xformTmp.eM11 = pxf1->eM11 * pxf2->eM11 + pxf1->eM12 * pxf2->eM21; - xformTmp.eM12 = pxf1->eM11 * pxf2->eM12 + pxf1->eM12 * pxf2->eM22; - xformTmp.eM21 = pxf1->eM21 * pxf2->eM11 + pxf1->eM22 * pxf2->eM21; - xformTmp.eM22 = pxf1->eM21 * pxf2->eM12 + pxf1->eM22 * pxf2->eM22; - xformTmp.eDx = pxf1->eDx * pxf2->eM11 + pxf1->eDy * pxf2->eM21 + pxf2->eDx; - xformTmp.eDy = pxf1->eDx * pxf2->eM12 + pxf1->eDy * pxf2->eM22 + pxf2->eDy; - + /* Do matrix multiplication, start with scaling elements */ + xformTmp.eM11 = (pxf1->eM11 * pxf2->eM11) + (pxf1->eM12 * pxf2->eM21); + xformTmp.eM22 = (pxf1->eM21 * pxf2->eM12) + (pxf1->eM22 * pxf2->eM22); + + /* Calculate shear/rotate elements only of they are present */ + if ((pxf1->eM12 != 0.) || (pxf1->eM21 != 0.) || + (pxf2->eM12 != 0.) || (pxf2->eM21 != 0.)) + { + xformTmp.eM12 = (pxf1->eM11 * pxf2->eM12) + (pxf1->eM12 * pxf2->eM22); + xformTmp.eM21 = (pxf1->eM21 * pxf2->eM11) + (pxf1->eM22 * pxf2->eM21); + } + else + { + xformTmp.eM12 = 0.; + xformTmp.eM21 = 0.; + } + + /* Calculate the offset */ + xformTmp.eDx = _fmul(pxf1->eDx, pxf2->eM11) + _fmul(pxf1->eDy, pxf2->eM21) + pxf2->eDx; + xformTmp.eDy = _fmul(pxf1->eDx, pxf2->eM12) + _fmul(pxf1->eDy, pxf2->eM22) + pxf2->eDy; + + /* Check for invalid offset ranges */ + if ((xformTmp.eDx > MAX_OFFSET) || (xformTmp.eDx < -MAX_OFFSET) || + (xformTmp.eDy > MAX_OFFSET) || (xformTmp.eDy < -MAX_OFFSET)) + { + return FALSE; + } + + /* All is ok, return the calculated values */ *pxfResult = xformTmp; -#if 0 - /* windows compatibility fixups (needs more work) */ - if (_isnan(xformTmp.eM12)) - { - if (pxf1->eM11 == 0 || pxf2->eM12 == 0) pxfResult->eM12 = 0.; - } -#endif - /* Check for invalid offset ranges */ - if (xformTmp.eDx > MAX_OFFSET || xformTmp.eDx < -MAX_OFFSET || - xformTmp.eDy > MAX_OFFSET || xformTmp.eDy < -MAX_OFFSET) - { - return FALSE; - } - - return TRUE; -} + return TRUE; +} + BOOL WINAPI
12 years, 8 months
1
0
0
0
[tkreuzer] 56420: [GDI32_APITEST] Add more tests for CombineTransform and cleanup the code a bit
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Apr 25 15:18:12 2012 New Revision: 56420 URL:
http://svn.reactos.org/svn/reactos?rev=56420&view=rev
Log: [GDI32_APITEST] Add more tests for CombineTransform and cleanup the code a bit Modified: trunk/rostests/apitests/gdi32/CombineTransform.c Modified: trunk/rostests/apitests/gdi32/CombineTransform.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CombineTra…
============================================================================== --- trunk/rostests/apitests/gdi32/CombineTransform.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/CombineTransform.c [iso-8859-1] Wed Apr 25 15:18:12 2012 @@ -10,7 +10,19 @@ #include <windows.h> #include <winddi.h> -#define ok_flt(x, y) ok(x == y, "Wrong value for " #x ", expected " #y ", got %f\n", (double)x); +typedef union +{ + float e; + long l; +} FLT_LONG; + +#define ok_flt(x, y) \ +{ \ + FLT_LONG __x, __y; \ + __x.e = (x); \ + __y.e = (y); \ + ok(__x.l == __y.l, "Wrong value for " #x ", expected " #y " (%f), got %f\n", (double)(y), (double)(x)); \ +} #define ok_xform(xform, m11, m12, m21, m22, dx, dy) \ ok_flt(xform.eM11, m11); \ @@ -20,6 +32,18 @@ ok_flt(xform.eDx, dx); \ ok_flt(xform.eDy, dy); +#define set_xform(pxform, m11, m12, m21, m22, dx, dy) \ + (pxform)->eM11 = m11; \ + (pxform)->eM12 = m12; \ + (pxform)->eM21 = m21; \ + (pxform)->eM22 = m22; \ + (pxform)->eDx = dx; \ + (pxform)->eDy = dy; + +float geINF; +float geIND; +float geQNAN; + void Test_CombineTransform() { XFORM xform1, xform2, xform3; @@ -37,14 +61,18 @@ ok_int(ret, 0); ok_int(GetLastError(), ERROR_SUCCESS); + /* 2 zero matrices */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + SetLastError(ERROR_SUCCESS); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_int(ret, 1); + ok_xform(xform3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + ok_int(GetLastError(), ERROR_SUCCESS); + /* 2 Identity matrices */ - xform1.eM11 = 1.0; - xform1.eM12 = 0; - xform1.eM21 = 0; - xform1.eM22 = 1.0; - xform1.eDx = 0; - xform1.eDy = 0; - xform2 = xform1; + set_xform(&xform1, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); + set_xform(&xform2, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); SetLastError(ERROR_SUCCESS); ret = CombineTransform(&xform3, &xform1, &xform2); ok_int(ret, 1); @@ -52,8 +80,8 @@ ok_int(GetLastError(), ERROR_SUCCESS); /* 2 Identity matrices with offsets */ - xform1.eDx = 20.0; - xform1.eDy = -100; + set_xform(&xform1, 1.0, 0.0, 0.0, 1.0, 20.0, -100.0); + set_xform(&xform2, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); ret = CombineTransform(&xform3, &xform1, &xform2); ok_int(ret, 1); ok_xform(xform3, 1.0, 0., 0., 1.0, 20.0, -100.0); @@ -91,24 +119,22 @@ ok_int(ret, 1); ok_xform(xform3, 8.0, -2.0, 2.25, 0.0, -670.0, -340.0); - xform1.eM11 = 1.; - xform1.eM12 = 0; - xform1.eM21 = 0; - xform1.eM22 = 1.; - xform1.eDx = 0; - xform1.eDy = 0; - xform2 = xform1; - + set_xform(&xform1, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); + set_xform(&xform2, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); + set_xform(&xform3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); xform1.eDx = 4294967167.999999761; ok(xform1.eDx == 4294967040.0, "float rounding error.\n"); ret = CombineTransform(&xform3, &xform1, &xform2); ok(ret == 1, "expected ret = 1, got %d\n", ret); - + ok_xform(xform3, 1.0, 0.0, 0.0, 1.0, 4294967040.0, 0.0); + + set_xform(&xform3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); xform1.eDx = 4294967167.999999762; ok(xform1.eDx == 4294967296.0, "float rounding error.\n"); ret = CombineTransform(&xform3, &xform1, &xform2); ok_int(ret, 0); ok_int(GetLastError(), ERROR_SUCCESS); + ok_xform(xform3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); xform1.eDx = -4294967167.999999761; ok(xform1.eDx == -4294967040.0, "float rounding error.\n"); @@ -130,6 +156,7 @@ xform2.eDy = 1; ret = CombineTransform(&xform3, &xform1, &xform2); ok_int(ret, 1); + ok_flt(xform3.eDy, 4294967040.0); xform1.eDy = 4294967167.999999762; ok(xform1.eDy == 4294967296.0, "float rounding error.\n"); @@ -152,8 +179,8 @@ ret = CombineTransform(&xform3, &xform1, &xform2); ok_int(ret, 1); + set_xform(&xform1, 1000.0, 0.0, 0.0, 0.0, 0.0, 0.0); xform1.eDx = -4294967167.999999762; - xform1.eM11 = 1000.0; xform2.eM11 = 1000.0; ret = CombineTransform(&xform3, &xform1, &xform2); ok_int(ret, 0); @@ -166,44 +193,140 @@ ok_int(GetLastError(), ERROR_SUCCESS); /* Some undefined values */ - *(DWORD*)&xform1.eM11 = 0xffc00000; // (0.0F/0.0F) - xform1.eM12 = 0; - xform1.eM21 = 0; - *(DWORD*)&xform1.eM22 = 0x7f800000; // (1.0F/0.0F) - xform1.eDx = 0; - xform1.eDy = 0; + set_xform(&xform1, geIND, 0.0, 0.0, geINF, 0.0, 0.0); xform2 = xform1; SetLastError(ERROR_SUCCESS); ret = CombineTransform(&xform3, &xform1, &xform2); ok_int(ret, 1); - ok(*(DWORD*)&xform3.eM11 == 0xffc00000, "eM11: Expected 0xffc00000, got 0x%lx\n", *(DWORD*)&xform3.eM11); - ok(xform3.eM12 == 0, "eM12: Expected 0, got %f\n", xform3.eM12); - ok(xform3.eM21 == 0, "eM21: Expected 0, got %f\n", xform3.eM21); - ok(*(DWORD*)&xform3.eM22 == 0x7f800000, "eM22: Expected 0x7f800000, got 0x%lx\n", *(DWORD*)&xform3.eM22); - ok(xform3.eDx == 0, "eDx: Expected 0, got %f\n", xform3.eDx); - ok(xform3.eDy == 0, "eDy: Expected 0, got %f\n", xform3.eDy); - ok_int(GetLastError(), ERROR_SUCCESS); + ok_xform(xform3, geIND, 0.0, 0.0, geINF, 0.0, 0.0); + ok_int(GetLastError(), ERROR_SUCCESS); + + set_xform(&xform2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_int(ret, 1); + ok_xform(xform3, geIND, geIND, geINF, geINF, 0.0, 0.0); + ok_int(GetLastError(), ERROR_SUCCESS); + + set_xform(&xform1, 18446743500000000000.0, 0.0, 1.0, 0.0, 0.0, 0.0); + xform2 = xform1; + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_int(ret, 1); + ok_flt(xform3.eM11, 340282326356119260000000000000000000000.0); + + xform1.eM11 = 18446745000000000000.0; + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_int(ret, 1); + ok_flt(xform3.eM11, 340282346638528860000000000000000000000.0); + + xform1.eM11 = 18446746000000000000.0; + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_long(*(DWORD*)&xform3.eM11, 0x7f800000); + + /* zero matrix + 1 invalid */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + *(DWORD*)&xform2.eM22 = 0x7f800000; // (0.0F/0.0F) + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_int(ret, 1); + ok_xform(xform3, 0.0, 0.0, 0.0, geIND, 0.0, 0.0); + + /* zero matrix + 1 invalid */ + xform2 = xform1; + *(DWORD*)&xform2.eM12 = 0x7f800000; // (0.0F/0.0F) + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_int(ret, 1); + ok_xform(xform3, 0.0, geIND, 0.0, geIND, 0.0, 0.0); /* Some undefined values */ - xform2.eM11 = 1.; - xform2.eM22 = 1.; - xform2.eM12 = 1.; - xform2.eM21 = 1.; - ret = CombineTransform(&xform3, &xform1, &xform2); - ok_int(ret, 1); - - ok_int(*(DWORD*)&xform3.eM11, 0xffc00000); - ok_int(*(DWORD*)&xform3.eM12, 0xffc00000); - ok_int(*(DWORD*)&xform3.eM21, 0x7f800000); - ok_int(*(DWORD*)&xform3.eM22, 0x7f800000); - ok(xform3.eDx == 0, "eDx: Expected 0, got %f\n", xform3.eDx); - ok(xform3.eDy == 0, "eDy: Expected 0, got %f\n", xform3.eDy); - ok_int(GetLastError(), ERROR_SUCCESS); - + set_xform(&xform1, 0.0, geIND, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, geIND, 0.0, 0.0, geINF, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_int(ret, 1); + ok_xform(xform3, geIND, geIND, geIND, geIND, 0.0, 0.0); + +} + +void Test_CombineTransform_Inval(float eInval, float eOut) +{ + XFORM xform1, xform2, xform3; + BOOL ret; + + /* zero matrix / M11 invalid */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, eInval, 0.0, 0.0, 0.0, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_xform(xform3, eOut, 0.0, 0.0, 0.0, 0.0, 0.0); // -> M21 + ret = CombineTransform(&xform3, &xform2, &xform1); + ok_xform(xform3, eOut, 0.0, 0.0, 0.0, 0.0, 0.0); // -> M12 + + /* zero matrix / M12 invalid */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, 0.0, eInval, 0.0, 0.0, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_xform(xform3, 0.0, eOut, 0.0, eOut, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform2, &xform1); + ok_xform(xform3, eOut, eOut, 0.0, 0.0, 0.0, 0.0); + + /* zero matrix / M21 invalid */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, 0.0, 0.0, eInval, 0.0, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_xform(xform3, eOut, 0.0, eOut, 0.0, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform2, &xform1); + ok_xform(xform3, 0.0, 0.0, eOut, eOut, 0.0, 0.0); + + /* zero matrix / M22 invalid */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, 0.0, 0.0, 0.0, eInval, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_xform(xform3, 0.0, 0.0, 0.0, eOut, 0.0, 0.0); // -> M12 + ret = CombineTransform(&xform3, &xform2, &xform1); + ok_xform(xform3, 0.0, 0.0, 0.0, eOut, 0.0, 0.0); // -> M21 + + /* zero matrix / M11,M12 invalid */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, eInval, eInval, 0.0, 0.0, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_xform(xform3, eOut, eOut, eOut, eOut, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform2, &xform1); + ok_xform(xform3, eOut, eOut, 0.0, 0.0, 0.0, 0.0); + + /* zero matrix / M11,M21 invalid */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, eInval, 0.0, eInval, 0.0, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_xform(xform3, eOut, 0.0, eOut, 0.0, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform2, &xform1); + ok_xform(xform3, eOut, eOut, eOut, eOut, 0.0, 0.0); + + /* zero matrix / M11,M22 invalid */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, eInval, 0.0, 0.0, eInval, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_xform(xform3, eOut, 0.0, 0.0, eOut, 0.0, 0.0); // -> M12, M21 + ret = CombineTransform(&xform3, &xform2, &xform1); + ok_xform(xform3, eOut, 0.0, 0.0, eOut, 0.0, 0.0); + + /* zero matrix / M12,M21 invalid */ + set_xform(&xform1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + set_xform(&xform2, 0.0, eInval, eInval, 0.0, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform1, &xform2); + ok_xform(xform3, eOut, eOut, eOut, eOut, 0.0, 0.0); + ret = CombineTransform(&xform3, &xform2, &xform1); + ok_xform(xform3, eOut, eOut, eOut, eOut, 0.0, 0.0); } START_TEST(CombineTransform) { + *(DWORD*)&geINF = 0x7f800000; + *(DWORD*)&geIND = 0xffc00000; + *(DWORD*)&geQNAN = 0x7fc00000; + Test_CombineTransform(); + + Test_CombineTransform_Inval(geINF, geIND); + Test_CombineTransform_Inval(geIND, geIND); + Test_CombineTransform_Inval(geQNAN, geQNAN); + }
12 years, 8 months
1
0
0
0
[tfaber] 56419: [NTDLL_APITEST] - Try GetProcAddress even on private functions. Allows easier testing in ROS by temporarily exporting them.
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Apr 25 13:06:30 2012 New Revision: 56419 URL:
http://svn.reactos.org/svn/reactos?rev=56419&view=rev
Log: [NTDLL_APITEST] - Try GetProcAddress even on private functions. Allows easier testing in ROS by temporarily exporting them. Modified: trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c trunk/rostests/apitests/ntdll/RtlDoesFileExists.c trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c Modified: trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlDetermi…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c [iso-8859-1] Wed Apr 25 13:06:30 2012 @@ -6,6 +6,7 @@ */ #define WIN32_NO_STATUS +#define UNICODE #include <wine/test.h> #include <pseh/pseh2.h> #include <ndk/mmfuncs.h> @@ -183,18 +184,22 @@ USHORT Length; if (!RtlDetermineDosPathNameType_Ustr) - skip("RtlDetermineDosPathNameType_Ustr unavailable\n"); + { + RtlDetermineDosPathNameType_Ustr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDetermineDosPathNameType_Ustr"); + if (!RtlDetermineDosPathNameType_Ustr) + skip("RtlDetermineDosPathNameType_Ustr unavailable\n"); + } StartSeh() RtlDetermineDosPathNameType_U(NULL); EndSeh(STATUS_ACCESS_VIOLATION); if (RtlDetermineDosPathNameType_Ustr) { - UNICODE_STRING PathString; - StartSeh() RtlDetermineDosPathNameType_Ustr(NULL); EndSeh(STATUS_ACCESS_VIOLATION); - - RtlInitEmptyUnicodeString(&PathString, NULL, MAXUSHORT); - PathType = RtlDetermineDosPathNameType_Ustr(&PathString); - ok(PathType == RtlPathTypeRelative, "PathType = %d\n", PathType); + UNICODE_STRING PathString; + StartSeh() RtlDetermineDosPathNameType_Ustr(NULL); EndSeh(STATUS_ACCESS_VIOLATION); + + RtlInitEmptyUnicodeString(&PathString, NULL, MAXUSHORT); + PathType = RtlDetermineDosPathNameType_Ustr(&PathString); + ok(PathType == RtlPathTypeRelative, "PathType = %d\n", PathType); } for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++) Modified: trunk/rostests/apitests/ntdll/RtlDoesFileExists.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlDoesFil…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlDoesFileExists.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlDoesFileExists.c [iso-8859-1] Wed Apr 25 13:06:30 2012 @@ -163,10 +163,52 @@ BOOL Success; HANDLE Handle; + if (!RtlDoesFileExists_UEx) + { + RtlDoesFileExists_UEx = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDoesFileExists_UEx"); + if (!RtlDoesFileExists_UEx) + skip("RtlDoesFileExists_UEx unavailable\n"); + } + + if (!RtlDoesFileExists_UStr) + { + RtlDoesFileExists_UStr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDoesFileExists_UStr"); + if (!RtlDoesFileExists_UStr) + skip("RtlDoesFileExists_UStr unavailable\n"); + } + + if (!RtlDoesFileExists_UstrEx) + { + RtlDoesFileExists_UstrEx = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlDoesFileExists_UstrEx"); + if (!RtlDoesFileExists_UstrEx) + skip("RtlDoesFileExists_UstrEx unavailable\n"); + } + StartSeh() Ret = RtlDoesFileExists_U(NULL); ok(Ret == FALSE, "NULL file exists?!\n"); EndSeh(STATUS_SUCCESS); + + if (RtlDoesFileExists_UEx) + { + StartSeh() + Ret = RtlDoesFileExists_UEx(NULL, TRUE); + ok(Ret == FALSE, "NULL file exists?!\n"); + Ret = RtlDoesFileExists_UEx(NULL, FALSE); + ok(Ret == FALSE, "NULL file exists?!\n"); + EndSeh(STATUS_SUCCESS); + } + + if (RtlDoesFileExists_UStr) + { + StartSeh() Ret = RtlDoesFileExists_UStr(NULL); EndSeh(STATUS_ACCESS_VIOLATION); + } + + if (RtlDoesFileExists_UstrEx) + { + StartSeh() RtlDoesFileExists_UstrEx(NULL, FALSE); EndSeh(STATUS_ACCESS_VIOLATION); + StartSeh() RtlDoesFileExists_UstrEx(NULL, TRUE); EndSeh(STATUS_ACCESS_VIOLATION); + } swprintf(FileName, L"C:\\%ls", CustomPath); /* Make sure this directory doesn't exist */ Modified: trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlGetFull…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c [iso-8859-1] Wed Apr 25 13:06:30 2012 @@ -6,6 +6,7 @@ */ #define WIN32_NO_STATUS +#define UNICODE #include <wine/test.h> #include <pseh/pseh2.h> #include <ndk/rtlfuncs.h> @@ -307,7 +308,14 @@ PATH_TYPE_AND_UNKNOWN PathType; if (!RtlGetFullPathName_Ustr) - return; + { + RtlGetFullPathName_Ustr = (PVOID)GetProcAddress(GetModuleHandle(L"ntdll"), "RtlGetFullPathName_Ustr"); + if (!RtlGetFullPathName_Ustr) + { + skip("RtlGetFullPathName_Ustr unavailable\n"); + return; + } + } /* NULL parameters */ StartSeh()
12 years, 8 months
1
0
0
0
[tkreuzer] 56418: {ROSTESTS] Fix compilation
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Apr 25 12:42:40 2012 New Revision: 56418 URL:
http://svn.reactos.org/svn/reactos?rev=56418&view=rev
Log: {ROSTESTS] Fix compilation Modified: trunk/rostests/apitests/gdi32/CombineRgn.c trunk/rostests/apitests/gdi32/CombineTransform.c trunk/rostests/apitests/gdi32/DPtoLP.c trunk/rostests/apitests/gdi32/GetDIBits.c trunk/rostests/apitests/gdi32/GetRandomRgn.c trunk/rostests/apitests/gdi32/PatBlt.c trunk/rostests/apitests/gdi32/SelectObject.c trunk/rostests/apitests/msvcrt/splitpath.c trunk/rostests/apitests/ntdll/SystemInfo.c Modified: trunk/rostests/apitests/gdi32/CombineRgn.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CombineRgn…
============================================================================== --- trunk/rostests/apitests/gdi32/CombineRgn.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/CombineRgn.c [iso-8859-1] Wed Apr 25 12:42:40 2012 @@ -9,13 +9,21 @@ #include <wine/test.h> #include <windows.h> -#define ok_long(expression, result) \ - { \ - int _value = (expression); \ - ok(_value == (result), "Wrong value for %s, expected " #result " (0x%x), got 0x%x\n", \ - #expression, (int)(result), _value); \ - } - +void Test_CombineRgn_Params() +{ + HRGN hrgn1, hrgn2, hrgn3; + + hrgn1 = CreateRectRgn(0, 0, 0, 0); + hrgn2 = CreateRectRgn(0, 0, 10, 10); + hrgn3 = CreateRectRgn(5, 5, 20, 20); + + SetLastError(0xbadbabe); + ok_long(CombineRgn(NULL, NULL, NULL, 0), ERROR); + ok_long(CombineRgn(hrgn1, hrgn2, hrgn3, 0), ERROR); + ok_long(CombineRgn(hrgn1, hrgn2, hrgn3, 6), ERROR); + ok_long(GetLastError(), 0xbadbabe); + +} void Test_CombineRgn_COPY() { @@ -189,6 +197,7 @@ START_TEST(CombineRgn) { + Test_CombineRgn_Params(); Test_CombineRgn_COPY(); Test_CombineRgn_AND(); Test_CombineRgn_OR(); Modified: trunk/rostests/apitests/gdi32/CombineTransform.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/CombineTra…
============================================================================== --- trunk/rostests/apitests/gdi32/CombineTransform.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/CombineTransform.c [iso-8859-1] Wed Apr 25 12:42:40 2012 @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS api tests * LICENSE: GPL - See COPYING in the top level directory - * PURPOSE: Test for CreatePen + * PURPOSE: Test for CombineTransform * PROGRAMMERS: Timo Kreuzer */ @@ -10,7 +10,6 @@ #include <windows.h> #include <winddi.h> -#define ok_int(x, y) ok(x == y, "Wrong value for " #x ", expected " #y ", got %ld\n", (long)x); #define ok_flt(x, y) ok(x == y, "Wrong value for " #x ", expected " #y ", got %f\n", (double)x); #define ok_xform(xform, m11, m12, m21, m22, dx, dy) \ Modified: trunk/rostests/apitests/gdi32/DPtoLP.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/DPtoLP.c?r…
============================================================================== --- trunk/rostests/apitests/gdi32/DPtoLP.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/DPtoLP.c [iso-8859-1] Wed Apr 25 12:42:40 2012 @@ -8,8 +8,6 @@ #include <stdio.h> #include <wine/test.h> #include <windows.h> - -#define ok_int(x, y) ok(x == y, "Wrong value for " #x ", expected " #y ", got %ld\n", (long)x); void Test_DPtoLP_Params() { Modified: trunk/rostests/apitests/gdi32/GetDIBits.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetDIBits.…
============================================================================== --- trunk/rostests/apitests/gdi32/GetDIBits.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetDIBits.c [iso-8859-1] Wed Apr 25 12:42:40 2012 @@ -8,8 +8,6 @@ #include <stdio.h> #include <wine/test.h> #include <windows.h> - -#define ok_err(dwErr) ok(GetLastError() == dwErr, "LastError is wrong, expected %d, got %ld\n", dwErr, GetLastError()) void Test_GetDIBits() { Modified: trunk/rostests/apitests/gdi32/GetRandomRgn.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetRandomR…
============================================================================== --- trunk/rostests/apitests/gdi32/GetRandomRgn.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/GetRandomRgn.c [iso-8859-1] Wed Apr 25 12:42:40 2012 @@ -15,14 +15,6 @@ #define SYSRGN 4 #define RGN5 5 -#define ok_int(x, exp) \ - ok((x) == (exp), "Failed test in line %d: value %s expected 0x%x, got 0x%x\n", \ - (int)__LINE__, #x, (int)(exp), (int)(x)) - -#define ok_long(x, exp) \ - ok((x) == (exp), "Failed test in line %d: value %s expected 0x%x, got 0x%x\n", \ - (int)__LINE__, #x, (int)(exp), (int)(x)) - HWND ghwnd; HDC ghdcWindow; Modified: trunk/rostests/apitests/gdi32/PatBlt.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/PatBlt.c?r…
============================================================================== --- trunk/rostests/apitests/gdi32/PatBlt.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/PatBlt.c [iso-8859-1] Wed Apr 25 12:42:40 2012 @@ -12,14 +12,6 @@ HBITMAP ghbmpTarget; PULONG gpulTargetBits; HDC hdcTarget; - -#define ok_int(x, exp) \ - ok((x) == (exp), "Failed test in line %d: value %s expected 0x%x, got 0x%x\n", \ - (int)__LINE__, #x, (int)(exp), (int)(x)) - -#define ok_long(x, exp) \ - ok((x) == (exp), "Failed test in line %d: value %s expected 0x%x, got 0x%x\n", \ - (int)__LINE__, #x, (int)(exp), (int)(x)) void Test_BrushOrigin() { Modified: trunk/rostests/apitests/gdi32/SelectObject.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/SelectObje…
============================================================================== --- trunk/rostests/apitests/gdi32/SelectObject.c [iso-8859-1] (original) +++ trunk/rostests/apitests/gdi32/SelectObject.c [iso-8859-1] Wed Apr 25 12:42:40 2012 @@ -14,8 +14,6 @@ #define TEST(x) ok(x, #x"\n") #define RTEST(x) ok(x, #x"\n") - -#define ok_err(dwErr) ok(GetLastError() == dwErr, "Wrong LastError, expected %d, got %ld\n", dwErr, GetLastError()) HDC hdc1, hdc2; Modified: trunk/rostests/apitests/msvcrt/splitpath.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/splitpath…
============================================================================== --- trunk/rostests/apitests/msvcrt/splitpath.c [iso-8859-1] (original) +++ trunk/rostests/apitests/msvcrt/splitpath.c [iso-8859-1] Wed Apr 25 12:42:40 2012 @@ -10,12 +10,6 @@ #include <stdlib.h> #include <strings.h> #include <stdarg.h> - -#define ok_str(x, y) \ - ok(strcmp(x, y) == 0, "got '%s', expected '%s'\n", x, y); - -#define ok_int(x, y) \ - ok(x == y, "got %d, expected %d\n", x, y); START_TEST(splitpath) { Modified: trunk/rostests/apitests/ntdll/SystemInfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/SystemInfo…
============================================================================== --- trunk/rostests/apitests/ntdll/SystemInfo.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/SystemInfo.c [iso-8859-1] Wed Apr 25 12:42:40 2012 @@ -9,13 +9,6 @@ #include <stdio.h> #include <wine/test.h> #include <ndk/ntndk.h> - -#define ok_long(x, y) \ - ok(x == y, "got %ld, expected %ld\n", (long)x, (long)y); - -#define ok_ntstatus(status, expected) \ - ok(status == expected, "got 0x%lx, expected 0x%lx\n", status, expected); -// ok(status == expected, "expected: " ##expected## ", got 0x%lx\n", status) void GetPrivilege()
12 years, 8 months
1
0
0
0
[tkreuzer] 56417: [WINETESTS] Add some useful macros to wine/test.h
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Apr 25 12:38:23 2012 New Revision: 56417 URL:
http://svn.reactos.org/svn/reactos?rev=56417&view=rev
Log: [WINETESTS] Add some useful macros to wine/test.h Modified: trunk/reactos/include/reactos/wine/test.h Modified: trunk/reactos/include/reactos/wine/test.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.…
============================================================================== --- trunk/reactos/include/reactos/wine/test.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/wine/test.h [iso-8859-1] Wed Apr 25 12:38:23 2012 @@ -623,4 +623,30 @@ // hack for ntdll winetest (this is defined in excpt.h) #undef exception_info +// Some helpful definitions + +#define ok_hex(expression, result) \ + { \ + int _value = (expression); \ + ok(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \ + #expression, (int)(result), _value); \ + } + +#define ok_dec(expression, result) \ + { \ + int _value = (expression); \ + ok(_value == (result), "Wrong value for '%s', expected: " #result " (%d), got: %d\n", \ + #expression, (int)(result), _value); \ + } + +#define ok_err(error) \ + ok(GetLastError() == (error), "Wrong last error. Expected " #error ", got %d\n", (int)GetLastError()) + +#define ok_str(x, y) \ + ok(strcmp(x, y) == 0, "Wrong string. Expected '%s', got '%s'\n", y, x); + +#define ok_long(expression, result) ok_hex(expression, result) +#define ok_int(expression, result) ok_dec(expression, result) +#define ok_ntstatus(status, expected) ok_hex(status, expected) + #endif /* __WINE_WINE_TEST_H */
12 years, 8 months
1
0
0
0
[tfaber] 56416: [NTDLL_APITEST] - Add a test for RtlDoesFileExists_U (and its three friends, if addresses are provided) - Various small path test improvements
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Apr 25 12:13:38 2012 New Revision: 56416 URL:
http://svn.reactos.org/svn/reactos?rev=56416&view=rev
Log: [NTDLL_APITEST] - Add a test for RtlDoesFileExists_U (and its three friends, if addresses are provided) - Various small path test improvements Added: trunk/rostests/apitests/ntdll/RtlDoesFileExists.c (with props) Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c trunk/rostests/apitests/ntdll/RtlGetFullPathName_U.c trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c trunk/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c trunk/rostests/apitests/ntdll/testlist.c Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/CMakeLists…
============================================================================== --- trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] Wed Apr 25 12:13:38 2012 @@ -3,6 +3,7 @@ NtAllocateVirtualMemory.c NtFreeVirtualMemory.c RtlDetermineDosPathNameType.c + RtlDoesFileExists.c RtlGetFullPathName_U.c RtlGetFullPathName_Ustr.c RtlGetFullPathName_UstrEx.c Modified: trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlDetermi…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlDetermineDosPathNameType.c [iso-8859-1] Wed Apr 25 12:13:38 2012 @@ -124,6 +124,7 @@ { L"::", RtlPathTypeDriveRelative }, { L":::", RtlPathTypeDriveRelative }, { L"::::", RtlPathTypeDriveRelative }, + { L"::\\", RtlPathTypeDriveAbsolute }, { L"\\", RtlPathTypeRooted }, { L"\\:", RtlPathTypeRooted }, { L"\\C:", RtlPathTypeRooted }, @@ -175,6 +176,7 @@ { L"/\\.", RtlPathTypeRootLocalDevice }, { L"//./", RtlPathTypeLocalDevice }, { L"//./C:/", RtlPathTypeLocalDevice }, + { L"%SystemRoot%", RtlPathTypeRelative }, }; ULONG i; PWSTR FileName; Added: trunk/rostests/apitests/ntdll/RtlDoesFileExists.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlDoesFil…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlDoesFileExists.c (added) +++ trunk/rostests/apitests/ntdll/RtlDoesFileExists.c [iso-8859-1] Wed Apr 25 12:13:38 2012 @@ -1,0 +1,273 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Test for RtlDoesFileExists_U* + * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de> + */ + +#define WIN32_NO_STATUS +#define UNICODE +#include <stdio.h> +#include <wine/test.h> +#include <pseh/pseh2.h> +#include <ndk/rtlfuncs.h> + +#define StartSeh() ExceptionStatus = STATUS_SUCCESS; _SEH2_TRY { +#define EndSeh(ExpectedStatus) } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { ExceptionStatus = _SEH2_GetExceptionCode(); } _SEH2_END; ok(ExceptionStatus == ExpectedStatus, "Exception %lx, expected %lx\n", ExceptionStatus, ExpectedStatus) + +#define ok_bool_file(value, expected, file) do { \ + if (expected) \ + ok(value == TRUE, "File '%ls' should exist, but does not\n", file); \ + else \ + ok(value == FALSE, "File '%ls' should not exist, but does\n", file);\ + } while (0) + +#define ok_eq_ustr(str1, str2) do { \ + ok((str1)->Buffer == (str2)->Buffer, "Buffer modified\n"); \ + ok((str1)->Length == (str2)->Length, "Length modified\n"); \ + ok((str1)->MaximumLength == (str2)->MaximumLength, "MaximumLength modified\n"); \ + } while (0) + +/* +BOOLEAN +NTAPI +RtlDoesFileExists_U( + IN PCWSTR FileName +); + +BOOLEAN +NTAPI +RtlDoesFileExists_UEx( + IN PCWSTR FileName, + IN BOOLEAN SucceedIfBusy +); + +BOOLEAN +NTAPI +RtlDoesFileExists_UStr( + IN PUNICODE_STRING FileName +); + +BOOLEAN +NTAPI +RtlDoesFileExists_UstrEx( + IN PCUNICODE_STRING FileName, + IN BOOLEAN SucceedIfBusy +); +*/ + +static +BOOLEAN +(NTAPI +*RtlDoesFileExists_UEx)( + IN PCWSTR FileName, + IN BOOLEAN SucceedIfBusy +) +//= (PVOID)0x7c8187d0 // 2003 sp1 x86 +//= (PVOID)0x7769aeb2 // win7 sp1 wow64 +; + +static +BOOLEAN +(NTAPI +*RtlDoesFileExists_UStr)( + IN PUNICODE_STRING FileName +) +//= (PVOID)0x7c8474e5 // 2003 sp1 x86 +//= (PVOID)0x776ff304 // win7 sp1 wow64 +; + +static +BOOLEAN +(NTAPI +*RtlDoesFileExists_UstrEx)( + IN PCUNICODE_STRING FileName, + IN BOOLEAN SucceedIfBusy +) +//= (PVOID)0x7c830f89 // 2003 sp1 x86 +//= (PVOID)0x7769addb // win7 sp1 wow64 +; + +START_TEST(RtlDoesFileExists) +{ + NTSTATUS ExceptionStatus; + BOOLEAN Ret; + struct + { + PCWSTR FileName; + BOOLEAN Exists; + } Tests[] = + { + { L"", FALSE }, + { L"?", FALSE }, + { L"*", FALSE }, + { L":", FALSE }, + { L";", FALSE }, + { L"\"", FALSE }, + { L".", TRUE }, + { L"..", TRUE }, + { L"/", TRUE }, + { L"//", FALSE }, + { L"///", FALSE }, + { L"\\/", FALSE }, + { L"\\//", FALSE }, + { L"\\\\/", FALSE }, + { L"\\/\\", FALSE }, + { L"\\/\\\\", FALSE }, + { L"\\/\\/\\", FALSE }, + { L"\\", TRUE }, + { L"\\\\", FALSE }, + { L"\\\\\\", FALSE }, + { L"\\\\.", FALSE }, + { L"\\\\.\\", FALSE }, + { L"\\\\.\\GLOBAL??", FALSE }, + { L"\\\\.\\GLOBAL??\\", FALSE }, + { L"\\\\?", FALSE }, + { L"\\\\??", FALSE }, + { L"\\\\??\\", FALSE }, + { L"\\\\??\\C:\\", FALSE }, + { L"\\\\.", FALSE }, + { L"\\\\.\\", FALSE }, + { L"C:", TRUE }, + { L"C:/", TRUE }, + { L"C:/\\", TRUE }, + { L"C:\\/", TRUE }, + { L"C:\\/\\", TRUE }, + { L"C://", TRUE }, + { L"C:\\", TRUE }, + { L"C:\\\\", TRUE }, + { L"C:\\%ls", TRUE }, + { L"C:/%ls", TRUE }, + { L"C://%ls", TRUE }, + { L"C:\\/%ls", TRUE }, + { L"C:/\\%ls", TRUE }, + { L"C:\\/\\%ls", TRUE }, + { L"C:\\%ls\\", TRUE }, + { L"C:\\%ls\\ThisFolderExists", TRUE }, + { L"C:\\%ls\\ThisDoesntExist", FALSE }, + { L"C:\\\\%ls\\\\ThisFolderExists", TRUE }, + { L"C:\\%ls\\ThisFolderExists\\ThisFileExists", TRUE }, + { L"c:\\%ls\\thisfolderexists\\thisfileexists", TRUE }, + { L"C:\\%ls\\THISFOLDEREXISTS\\THISFILEEXISTS", TRUE }, + { L"C:\\%ls;C:\\", FALSE }, + { L"%%SystemRoot%%", FALSE }, + { L"%%SystemRoot%%\\", FALSE }, + { L"%%SystemRoot%%\\system32", FALSE }, + { L"NUL", FALSE }, + { L"CON", FALSE }, + { L"COM1", FALSE }, + }; + ULONG i; + WCHAR FileName[MAX_PATH]; + WCHAR CustomPath[MAX_PATH] = L"RtlDoesFileExists_U_TestPath"; + BOOL Success; + HANDLE Handle; + + StartSeh() + Ret = RtlDoesFileExists_U(NULL); + ok(Ret == FALSE, "NULL file exists?!\n"); + EndSeh(STATUS_SUCCESS); + + swprintf(FileName, L"C:\\%ls", CustomPath); + /* Make sure this directory doesn't exist */ + while (GetFileAttributes(FileName) != INVALID_FILE_ATTRIBUTES) + { + wcscat(CustomPath, L"X"); + swprintf(FileName, L"C:\\%ls", CustomPath); + } + Success = CreateDirectory(FileName, NULL); + ok(Success, "CreateDirectory failed, results might not be accurate\n"); + swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); + Success = CreateDirectory(FileName, NULL); + ok(Success, "CreateDirectory failed, results might not be accurate\n"); + swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath); + Handle = CreateFile(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); + ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n"); + if (Handle != INVALID_HANDLE_VALUE) + { + /* Check SucceedIfBusy behavior */ + if (RtlDoesFileExists_UEx) + { + Ret = RtlDoesFileExists_UEx(FileName, TRUE); + ok_bool_file(Ret, TRUE, FileName); + /* TODO: apparently we have to do something worse to make this fail */ + Ret = RtlDoesFileExists_UEx(FileName, FALSE); + ok_bool_file(Ret, TRUE, FileName); + } + if (RtlDoesFileExists_UstrEx) + { + UNICODE_STRING FileNameString; + UNICODE_STRING TempString; + RtlInitUnicodeString(&FileNameString, FileName); + TempString = FileNameString; + Ret = RtlDoesFileExists_UstrEx(&FileNameString, TRUE); + ok_eq_ustr(&FileNameString, &TempString); + ok_bool_file(Ret, TRUE, FileName); + /* TODO: apparently we have to do something worse to make this fail */ + Ret = RtlDoesFileExists_UstrEx(&FileNameString, FALSE); + ok_eq_ustr(&FileNameString, &TempString); + ok_bool_file(Ret, TRUE, FileName); + } + CloseHandle(Handle); + } + + for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++) + { + swprintf(FileName, Tests[i].FileName, CustomPath); + StartSeh() + Ret = RtlDoesFileExists_U(FileName); + ok_bool_file(Ret, Tests[i].Exists, FileName); + EndSeh(STATUS_SUCCESS); + if (RtlDoesFileExists_UEx) + { + StartSeh() + Ret = RtlDoesFileExists_UEx(FileName, TRUE); + ok_bool_file(Ret, Tests[i].Exists, FileName); + EndSeh(STATUS_SUCCESS); + StartSeh() + Ret = RtlDoesFileExists_UEx(FileName, FALSE); + ok_bool_file(Ret, Tests[i].Exists, FileName); + EndSeh(STATUS_SUCCESS); + } + /* TODO: use guarded memory to make sure these don't touch the null terminator */ + if (RtlDoesFileExists_UStr) + { + UNICODE_STRING FileNameString; + UNICODE_STRING TempString; + RtlInitUnicodeString(&FileNameString, FileName); + TempString = FileNameString; + StartSeh() + Ret = RtlDoesFileExists_UStr(&FileNameString); + ok_bool_file(Ret, Tests[i].Exists, FileName); + EndSeh(STATUS_SUCCESS); + ok_eq_ustr(&FileNameString, &TempString); + } + if (RtlDoesFileExists_UstrEx) + { + UNICODE_STRING FileNameString; + UNICODE_STRING TempString; + RtlInitUnicodeString(&FileNameString, FileName); + TempString = FileNameString; + StartSeh() + Ret = RtlDoesFileExists_UstrEx(&FileNameString, TRUE); + ok_bool_file(Ret, Tests[i].Exists, FileName); + EndSeh(STATUS_SUCCESS); + ok_eq_ustr(&FileNameString, &TempString); + StartSeh() + Ret = RtlDoesFileExists_UstrEx(&FileNameString, FALSE); + ok_bool_file(Ret, Tests[i].Exists, FileName); + EndSeh(STATUS_SUCCESS); + ok_eq_ustr(&FileNameString, &TempString); + } + } + + swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath); + Success = DeleteFile(FileName); + ok(Success, "DeleteFile failed, test might leave stale file\n"); + swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); + Success = RemoveDirectory(FileName); + ok(Success, "RemoveDirectory failed, test might leave stale directory\n"); + swprintf(FileName, L"C:\\%ls", CustomPath); + Success = RemoveDirectory(FileName); + ok(Success, "RemoveDirectory failed, test might leave stale directory\n"); +} Propchange: trunk/rostests/apitests/ntdll/RtlDoesFileExists.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/ntdll/RtlGetFullPathName_U.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlGetFull…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlGetFullPathName_U.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlGetFullPathName_U.c [iso-8859-1] Wed Apr 25 12:13:38 2012 @@ -91,7 +91,8 @@ VOID RunTestCases(VOID) { - /* TODO: don't duplicate this here and in the RtlGetFullPathName_UstrEx test */ + /* TODO: don't duplicate this in the other tests */ + /* TODO: Drive Relative tests don't work yet if the current drive isn't C: */ struct { PCWSTR FileName; Modified: trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlGetFull…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c [iso-8859-1] Wed Apr 25 12:13:38 2012 @@ -39,7 +39,7 @@ IN PWSTR Buffer, OUT PCWSTR *ShortName, OUT PBOOLEAN InvalidName, - OUT PATH_TYPE_AND_UNKNOWN* PathType + OUT PATH_TYPE_AND_UNKNOWN *PathType ) //= (PVOID)0x7c83086c // 2003 sp1 x86 //= (PVOID)0x7769a3dd // win7 sp1 wow64 @@ -103,6 +103,25 @@ return Result; } +static +BOOLEAN +CheckBuffer( + PVOID Buffer, + SIZE_T Size, + UCHAR Value) +{ + PUCHAR Array = Buffer; + SIZE_T i; + + for (i = 0; i < Size; i++) + if (Array[i] != Value) + { + trace("Expected %x, found %x at offset %lu\n", Value, Array[i], (ULONG)i); + return FALSE; + } + return TRUE; +} + #define RtlPathTypeNotSet 123 #define InvalidPointer ((PVOID)0x0123456789ABCDEFULL) @@ -122,7 +141,8 @@ VOID RunTestCases(VOID) { - /* TODO: don't duplicate this here and in the RtlGetFullPathName_U test */ + /* TODO: don't duplicate this in the other tests */ + /* TODO: Drive Relative tests don't work yet if the current drive isn't C: */ struct { PCWSTR FileName; @@ -283,6 +303,7 @@ UNICODE_STRING TempString; PCWSTR ShortName; BOOLEAN NameInvalid; + BOOLEAN NameInvalidArray[sizeof(ULONGLONG)]; PATH_TYPE_AND_UNKNOWN PathType; if (!RtlGetFullPathName_Ustr) @@ -312,10 +333,9 @@ StartSeh() RtlGetFullPathName_Ustr(NULL, 0, NULL, NULL, NULL, &PathType); EndSeh(STATUS_ACCESS_VIOLATION); - ok(PathType.Type == RtlPathTypeUnknown || - broken(PathType.Type == RtlPathTypeNotSet) /* Win7 */, "PathType = %d\n", PathType.Type); - ok(PathType.Unknown == 1234 || - broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); + ok(PathType.Type == RtlPathTypeUnknown, "PathType = %d\n", PathType.Type); + ok(PathType.Unknown == 1234 || + broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); /* check what else is initialized before it crashes */ PathType.Type = RtlPathTypeNotSet; @@ -327,9 +347,8 @@ EndSeh(STATUS_ACCESS_VIOLATION); ok(NameInvalid == FALSE, "NameInvalid = %u\n", NameInvalid); ok(ShortName == InvalidPointer || - broken(ShortName == NULL), "ShortName = %p\n", ShortName); - ok(PathType.Type == RtlPathTypeUnknown || - broken(PathType.Type == RtlPathTypeNotSet) /* Win7 */, "PathType = %d\n", PathType.Type); + broken(ShortName == NULL) /* Win7 */, "ShortName = %p\n", ShortName); + ok(PathType.Type == RtlPathTypeUnknown, "PathType = %d\n", PathType.Type); ok(PathType.Unknown == 1234 || broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); @@ -342,9 +361,8 @@ EndSeh(STATUS_ACCESS_VIOLATION); ok_eq_ustr(&FileName, &TempString); ok(ShortName == InvalidPointer || - broken(ShortName == NULL), "ShortName = %p\n", ShortName); - ok(NameInvalid == FALSE || - broken(NameInvalid == (BOOLEAN)-1) /* Win7 */, "NameInvalid = %u\n", NameInvalid); + broken(ShortName == NULL) /* Win7 */, "ShortName = %p\n", ShortName); + ok(NameInvalid == FALSE, "NameInvalid = %u\n", NameInvalid); /* This is the first one that doesn't crash. FileName and PathType cannot be NULL */ RtlInitUnicodeString(&FileName, NULL); @@ -373,6 +391,23 @@ ok(PathType.Unknown == 1234 || broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); + /* Show that NameInvalid is indeed BOOLEAN */ + RtlInitUnicodeString(&FileName, L""); + TempString = FileName; + PathType.Type = RtlPathTypeNotSet; + PathType.Unknown = 1234; + RtlFillMemory(NameInvalidArray, sizeof(NameInvalidArray), 0x55); + StartSeh() + Length = RtlGetFullPathName_Ustr(&FileName, 0, NULL, NULL, NameInvalidArray, &PathType); + ok(Length == 0, "Length = %lu\n", Length); + EndSeh(STATUS_SUCCESS); + ok_eq_ustr(&FileName, &TempString); + ok(PathType.Type == RtlPathTypeUnknown, "PathType = %d\n", PathType.Type); + ok(PathType.Unknown == 1234 || + broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); + ok(NameInvalidArray[0] == FALSE, "NameInvalid = %u\n", NameInvalidArray[0]); + ok(CheckBuffer(NameInvalidArray + 1, sizeof(NameInvalidArray) - sizeof(NameInvalidArray[0]), 0x55), "CheckBuffer failed\n"); + /* Give it a valid path */ RtlInitUnicodeString(&FileName, L"C:\\test"); TempString = FileName; Modified: trunk/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/RtlGetFull…
============================================================================== --- trunk/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c [iso-8859-1] Wed Apr 25 12:13:38 2012 @@ -81,6 +81,25 @@ return Result; } +static +BOOLEAN +CheckBuffer( + PVOID Buffer, + SIZE_T Size, + UCHAR Value) +{ + PUCHAR Array = Buffer; + SIZE_T i; + + for (i = 0; i < Size; i++) + if (Array[i] != Value) + { + trace("Expected %x, found %x at offset %lu\n", Value, Array[i], (ULONG)i); + return FALSE; + } + return TRUE; +} + #define RtlPathTypeNotSet 123 #define InvalidPointer ((PVOID)0x0123456789ABCDEFULL) @@ -100,7 +119,8 @@ VOID RunTestCases(VOID) { - /* TODO: don't duplicate this here and in the RtlGetFullPathName_U test */ + /* TODO: don't duplicate this in the other tests */ + /* TODO: Drive Relative tests don't work yet if the current drive isn't C: */ struct { PCWSTR FileName; @@ -261,6 +281,7 @@ PUNICODE_STRING StringUsed; SIZE_T FilePartSize; BOOLEAN NameInvalid; + BOOLEAN NameInvalidArray[sizeof(ULONGLONG)]; RTL_PATH_TYPE PathType; SIZE_T LengthNeeded; @@ -343,6 +364,20 @@ ok_eq_ustr(&FileName, &TempString); ok(PathType == RtlPathTypeUnknown, "PathType = %d\n", PathType); + /* Show that NameInvalid is indeed BOOLEAN */ + RtlInitUnicodeString(&FileName, L""); + TempString = FileName; + PathType = RtlPathTypeNotSet; + RtlFillMemory(NameInvalidArray, sizeof(NameInvalidArray), 0x55); + StartSeh() + Status = RtlGetFullPathName_UstrEx(&FileName, NULL, NULL, NULL, NULL, NameInvalidArray, &PathType, NULL); + ok(Status == STATUS_OBJECT_NAME_INVALID, "status = %lx\n", Status); + EndSeh(STATUS_SUCCESS); + ok_eq_ustr(&FileName, &TempString); + ok(PathType == RtlPathTypeUnknown, "PathType = %d\n", PathType); + ok(NameInvalidArray[0] == FALSE, "NameInvalid = %u\n", NameInvalidArray[0]); + ok(CheckBuffer(NameInvalidArray + 1, sizeof(NameInvalidArray) - sizeof(NameInvalidArray[0]), 0x55), "CheckBuffer failed\n"); + /* Give it a valid path */ RtlInitUnicodeString(&FileName, L"C:\\test"); TempString = FileName; Modified: trunk/rostests/apitests/ntdll/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/testlist.c…
============================================================================== --- trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] Wed Apr 25 12:13:38 2012 @@ -9,6 +9,7 @@ extern void func_NtFreeVirtualMemory(void); extern void func_NtSystemInformation(void); extern void func_RtlDetermineDosPathNameType(void); +extern void func_RtlDoesFileExists(void); extern void func_RtlGetFullPathName_U(void); extern void func_RtlGetFullPathName_Ustr(void); extern void func_RtlGetFullPathName_UstrEx(void); @@ -22,6 +23,7 @@ { "NtFreeVirtualMemory", func_NtFreeVirtualMemory }, { "NtSystemInformation", func_NtSystemInformation }, { "RtlDetermineDosPathNameType", func_RtlDetermineDosPathNameType }, + { "RtlDoesFileExists", func_RtlDoesFileExists }, { "RtlGetFullPathName_U", func_RtlGetFullPathName_U }, { "RtlGetFullPathName_Ustr", func_RtlGetFullPathName_Ustr }, { "RtlGetFullPathName_UstrEx", func_RtlGetFullPathName_UstrEx },
12 years, 8 months
1
0
0
0
[tfaber] 56415: [NDK] - Remove RtlDoesFileExists_UstrEx
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Apr 25 12:04:44 2012 New Revision: 56415 URL:
http://svn.reactos.org/svn/reactos?rev=56415&view=rev
Log: [NDK] - Remove RtlDoesFileExists_UstrEx Modified: trunk/reactos/include/ndk/rtlfuncs.h Modified: trunk/reactos/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Wed Apr 25 12:04:44 2012 @@ -2495,14 +2495,6 @@ NTAPI RtlDoesFileExists_U( IN PCWSTR FileName -); - -NTSYSAPI -BOOLEAN -NTAPI -RtlDoesFileExists_UstrEx( - IN PCUNICODE_STRING FileName, - IN BOOLEAN SucceedIfBusy ); NTSYSAPI
12 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200