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
[jimtabor] 33907: - Fix Ellipes, for Filip Navara, nice work! - Ref: http://www.reactos.org/archives/public/ros-dev/2007-January/009090.html - Test: http://www.reactos.org/pipermail/ros-dev/attachments/20070118/46ace072/attachment-0001.exe
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Jun 9 11:46:52 2008 New Revision: 33907 URL:
http://svn.reactos.org/svn/reactos?rev=33907&view=rev
Log: - Fix Ellipes, for Filip Navara, nice work! - Ref:
http://www.reactos.org/archives/public/ros-dev/2007-January/009090.html
- Test:
http://www.reactos.org/pipermail/ros-dev/attachments/20070118/46ace072/atta…
Modified: trunk/reactos/subsystems/win32/win32k/objects/fillshap.c Modified: trunk/reactos/subsystems/win32/win32k/objects/fillshap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] Mon Jun 9 11:46:52 2008 @@ -166,6 +166,8 @@ return TRUE; } + + /******************************************************************************/ /* @@ -205,12 +207,22 @@ PDC dc; PDC_ATTR Dc_Attr; BOOL ret = TRUE, Cond1, Cond2; - +/* top + ___________________ + +| | + | | + | | + left | | right + | | + | | + 0|___________________| + 0 bottom + + */ /* * Check the parameters. */ - - if (nRightRect <= nLeftRect || nBottomRect <= nTopRect) + DPRINT("nLeftRect: %d, nTopRect: %d, nRightRect: %d, nBottomRect: %d\n",nLeftRect,nTopRect,nRightRect,nBottomRect); + if (nRightRect <= nLeftRect || nTopRect <= nBottomRect) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return FALSE; @@ -272,28 +284,25 @@ RectBounds.bottom = nBottomRect; IntLPtoDP(dc, (LPPOINT)&RectBounds, 2); + DPRINT("1: Left: %d, Top: %d, Right: %d, Bottom: %d\n", + RectBounds.left,RectBounds.top,RectBounds.right,RectBounds.bottom); RectBounds.left += dc->ptlDCOrig.x; RectBounds.right += dc->ptlDCOrig.x; RectBounds.top += dc->ptlDCOrig.y; RectBounds.bottom += dc->ptlDCOrig.y; - - RadiusX = max((RectBounds.right - RectBounds.left) >> 1, 1); - RadiusY = max((RectBounds.bottom - RectBounds.top) >> 1, 1); + DPRINT("2: Left: %d, Top: %d, Right: %d, Bottom: %d\n", + RectBounds.left,RectBounds.top,RectBounds.right,RectBounds.bottom); + + RadiusX = (RectBounds.right - RectBounds.left)/2; + RadiusY = (RectBounds.bottom - RectBounds.top)/2; CenterX = RectBounds.left + RadiusX; CenterY = RectBounds.top + RadiusY; - - if (RadiusX > RadiusY) - { - nx = RadiusX; - ny = RadiusY; - } - else - { - nx = RadiusY; - ny = RadiusX; - } - + DPRINT("3: RadiusX: %d, RadiusY: %d, CenterX: %d, CenterY: %d\n", + RadiusX,RadiusY,CenterX,CenterY); + + nx = RadiusX; + ny = -RadiusY; da = -1; db = 0xFFFF; ix = 0; @@ -389,7 +398,7 @@ BRUSHOBJ_UnlockBrush(FillBrush); PENOBJ_UnlockPen(PenBrush); DC_UnlockDc(dc); - + DPRINT("NtGdiEllipse exit \n"); return ret; }
16 years, 6 months
1
0
0
0
[jimtabor] 33906: Move old pie code into arc.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Jun 8 14:00:50 2008 New Revision: 33906 URL:
http://svn.reactos.org/svn/reactos?rev=33906&view=rev
Log: Move old pie code into arc. Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c trunk/reactos/subsystems/win32/win32k/objects/fillshap.c Modified: trunk/reactos/subsystems/win32/win32k/objects/arc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/arc.c [iso-8859-1] Sun Jun 8 14:00:50 2008 @@ -3,6 +3,425 @@ #define NDEBUG #include <debug.h> + +typedef struct tagSHAPEPOINT +{ + int X; + int Y; + int Type; +} SHAPEPOINT, *PSHAPEPOINT; + +#define SHAPEPOINT_TYPE_CIRCLE 'C' +#define SHAPEPOINT_TYPE_LINE_RIGHT 'R' /* Fill at right side of line */ +#define SHAPEPOINT_TYPE_LINE_LEFT 'L' /* Fill at left side of line */ + +#define SETPOINT(x, y, type) \ + ShapePoints[*PointCount].X = (x); \ + ShapePoints[*PointCount].Y = (y); \ + ShapePoints[*PointCount].Type = (type); \ + (*PointCount)++ + +#define SETCIRCLEPOINT(x, y) \ + SETPOINT(x, y, SHAPEPOINT_TYPE_CIRCLE) + +#ifdef TODO +STATIC VOID +FASTCALL +CirclePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top, + int Right, int Bottom) +{ + int X, X18, X27, X36, X45; + int Y, Y14, Y23, Y58, Y67; + int d, Radius; + BOOL Even; + + Even = (0 == (Right - Left) % 2); + Right--; + Bottom--; + Radius = (Right - Left) >> 1; + + if (Even) + { + X = 0; + Y = Radius; + d = 2 - Radius; + X18 = Right; + X27 = ((Left + Right) >> 1) + 1; + X36 = (Left + Right) >> 1; + X45 = Left; + Y14 = Top + Radius; + Y23 = Top; + Y58 = Top + Radius + 1; + Y67 = Top + (Right - Left); + ShapePoints[*PointCount].X = X27; + SETCIRCLEPOINT(X27, Y23); + SETCIRCLEPOINT(X36, Y23); + SETCIRCLEPOINT(X18, Y14); + SETCIRCLEPOINT(X45, Y14); + SETCIRCLEPOINT(X18, Y58); + SETCIRCLEPOINT(X45, Y58); + SETCIRCLEPOINT(X27, Y67); + SETCIRCLEPOINT(X36, Y67); + } + else + { + X = 0; + Y = Radius; + d = 1 - Radius; + X18 = Right; + X27 = (Left + Right) >> 1; + X36 = (Left + Right) >> 1; + X45 = Left; + Y14 = Top + Radius; + Y23 = Top; + Y58 = Top + Radius; + Y67 = Top + (Right - Left); + SETCIRCLEPOINT(X27, Y23); + SETCIRCLEPOINT(X45, Y14); + SETCIRCLEPOINT(X18, Y58); + SETCIRCLEPOINT(X27, Y67); + } + + while (X < Y) + { + if (d < 0) + { + d += (X << 1) + (Even ? 4 : 3); + + X27++; + X36--; + Y14--; + Y58++; + } + else + { + d += ((X - Y) << 1) + 5; + Y--; + + Y23++; + Y67--; + X18--; + X45++; + X27++; + X36--; + Y14--; + Y58++; + } + X++; + + SETCIRCLEPOINT(X27, Y23); + SETCIRCLEPOINT(X36, Y23); + SETCIRCLEPOINT(X18, Y14); + SETCIRCLEPOINT(X45, Y14); + SETCIRCLEPOINT(X18, Y58); + SETCIRCLEPOINT(X45, Y58); + SETCIRCLEPOINT(X27, Y67); + SETCIRCLEPOINT(X36, Y67); + } +} + +STATIC VOID +LinePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top, + int Right, int Bottom, int XTo, int YTo, BOOL Start) +{ + LONG x, y, deltax, deltay, i, xchange, ychange, error; + int Type; + + x = (Right + Left) >> 1; + y = (Bottom + Top) >> 1; + deltax = XTo - x; + deltay = YTo - y; + + if (deltax < 0) + { + xchange = -1; + deltax = - deltax; + x--; + } + else + { + xchange = 1; + } + + if (deltay < 0) + { + ychange = -1; + deltay = - deltay; + y--; + Type = (Start ? SHAPEPOINT_TYPE_LINE_LEFT : SHAPEPOINT_TYPE_LINE_RIGHT); + } + else + { + ychange = 1; + Type = (Start ? SHAPEPOINT_TYPE_LINE_RIGHT : SHAPEPOINT_TYPE_LINE_LEFT); + } + + if (y == YTo) + { + for (i = x; i <= XTo; i++) + { + SETPOINT(i, y, Type); + } + } + else if (x == XTo) + { + for (i = y; i <= YTo; i++) + { + SETPOINT(x, i, Type); + } + } + else + { + error = 0; + + if (deltax < deltay) + { + for (i = 0; i < deltay; i++) + { + SETPOINT(x, y, Type); + y = y + ychange; + error = error + deltax; + + if (deltay <= error) + { + x = x + xchange; + error = error - deltay; + } + } + } + else + { + for (i = 0; i < deltax; i++) + { + SETPOINT(x, y, Type); + x = x + xchange; + error = error + deltay; + if (deltax <= error) + { + y = y + ychange; + error = error - deltax; + } + } + } + } +} + +STATIC int +CDECL +CompareShapePoints(const void *pv1, const void *pv2) +{ + if (((const PSHAPEPOINT) pv1)->Y < ((const PSHAPEPOINT) pv2)->Y) + { + return -1; + } + else if (((const PSHAPEPOINT) pv2)->Y < ((const PSHAPEPOINT) pv1)->Y) + { + return +1; + } + else if (((const PSHAPEPOINT) pv1)->X < ((const PSHAPEPOINT) pv2)->X) + { + return -1; + } + else if (((const PSHAPEPOINT) pv2)->X < ((const PSHAPEPOINT) pv1)->X) + { + return +1; + } + else + { + return 0; + } +} +#endif + + +BOOL +STDCALL +NtGdiPie(HDC hDC, + int Left, + int Top, + int Right, + int Bottom, + int XRadialStart, + int YRadialStart, + int XRadialEnd, + int YRadialEnd) +{ +#ifdef TODO + PDC dc; + PDC_ATTR; + RECTL RectBounds; + SURFOBJ *SurfObj; + BRUSHOBJ PenBrushObj; + PBRUSHOBJ FillBrushObj; + PSHAPEPOINT ShapePoints; + UINT Point, PointCount; + BOOL ret = TRUE; + int Y, CircleStart, CircleEnd, LineStart, LineEnd; + BOOL FullFill; + + if (Right <= Left || Bottom <= Top) + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (Right - Left != Bottom - Top) + { + UNIMPLEMENTED; + } + + dc = DC_LockDc ( hDC ); + if (NULL == dc) + { + SetLastWin32Error(ERROR_INVALID_HANDLE); + return FALSE; + } + if (dc->DC_Type == DC_TYPE_INFO) + { + DC_UnlockDc(dc); + /* Yes, Windows really returns TRUE in this case */ + return TRUE; + } + + Dc_Attr = dc->pDc_Attr; + if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; + + FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush); + if (NULL == FillBrushObj) + { + DC_UnlockDc(dc); + SetLastWin32Error(ERROR_INTERNAL_ERROR); + return FALSE; + } + + Left += dc->ptlDCOrig.x; + Right += dc->ptlDCOrig.x; + Top += dc->ptlDCOrig.y; + Bottom += dc->ptlDCOrig.y; + XRadialStart += dc->ptlDCOrig.x; + YRadialStart += dc->ptlDCOrig.y; + XRadialEnd += dc->ptlDCOrig.x; + YRadialEnd += dc->ptlDCOrig.y; + + RectBounds.left = Left; + RectBounds.right = Right; + RectBounds.top = Top; + RectBounds.bottom = Bottom; + + SurfObj = (SURFOBJ*) AccessUserObject((ULONG)dc->Surface); + HPenToBrushObj(&PenBrushObj, Dc_Attr->hpen); + + /* Number of points for the circle is 4 * sqrt(2) * Radius, start + and end line have at most Radius points, so allocate at least + that much */ + ShapePoints = ExAllocatePoolWithTag(PagedPool, 8 * (Right - Left + 1) / 2 * sizeof(SHAPEPOINT), TAG_SHAPE); + if (NULL == ShapePoints) + { + BRUSHOBJ_UnlockBrush(FillBrushObj); + DC_UnlockDc(dc); + + SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + + if (Left == Right) + { + PUTPIXEL(Left, Top, &PenBrushObj); + BRUSHOBJ_UnlockBrush(FillBrushObj); + DC_UnlockDc(dc); + + return ret; + } + + PointCount = 0; + CirclePoints(&PointCount, ShapePoints, Left, Top, Right, Bottom); + LinePoints(&PointCount, ShapePoints, Left, Top, Right, Bottom, + XRadialStart, YRadialStart, TRUE); + LinePoints(&PointCount, ShapePoints, Left, Top, Right, Bottom, + XRadialEnd, YRadialEnd, FALSE); + ASSERT(PointCount <= 8 * (Right - Left + 1) / 2); + EngSort((PBYTE) ShapePoints, sizeof(SHAPEPOINT), PointCount, CompareShapePoints); + + FullFill = TRUE; + Point = 0; + while (Point < PointCount) + { + Y = ShapePoints[Point].Y; + + /* Skip any line pixels before circle */ + while (Point < PointCount && ShapePoints[Point].Y == Y + && SHAPEPOINT_TYPE_CIRCLE != ShapePoints[Point].Type) + { + Point++; + } + + /* Handle left side of circle */ + if (Point < PointCount && ShapePoints[Point].Y == Y) + { + CircleStart = ShapePoints[Point].X; + Point++; + while (Point < PointCount && ShapePoints[Point].Y == Y + && ShapePoints[Point].X == ShapePoints[Point - 1].X + 1 + && SHAPEPOINT_TYPE_CIRCLE == ShapePoints[Point].Type) + { + Point++; + } + CircleEnd = ShapePoints[Point - 1].X; + + PUTLINE(CircleStart, Y, CircleEnd + 1, Y, &PenBrushObj); + } + + /* Handle line(s) (max 2) inside the circle */ + while (Point < PointCount && ShapePoints[Point].Y == Y + && SHAPEPOINT_TYPE_CIRCLE != ShapePoints[Point].Type) + { + LineStart = ShapePoints[Point].X; + Point++; + while (Point < PointCount && ShapePoints[Point].Y == Y + && ShapePoints[Point].X == ShapePoints[Point - 1].X + 1 + && ShapePoints[Point].Type == ShapePoints[Point - 1].Type) + { + Point++; + } + LineEnd = ShapePoints[Point - 1].X; + + PUTLINE(LineStart, Y, LineEnd + 1, Y, &PenBrushObj); + } + + /* Handle right side of circle */ + while (Point < PointCount && ShapePoints[Point].Y == Y + && SHAPEPOINT_TYPE_CIRCLE == ShapePoints[Point].Type) + { + CircleStart = ShapePoints[Point].X; + Point++; + while (Point < PointCount && ShapePoints[Point].Y == Y + && ShapePoints[Point].X == ShapePoints[Point - 1].X + 1 + && SHAPEPOINT_TYPE_CIRCLE == ShapePoints[Point].Type) + { + Point++; + } + CircleEnd = ShapePoints[Point - 1].X; + + PUTLINE(CircleStart, Y, CircleEnd + 1, Y, &PenBrushObj); + } + + /* Skip any line pixels after circle */ + while (Point < PointCount && ShapePoints[Point].Y == Y) + { + Point++; + } + } + + ExFreePool(ShapePoints); + BRUSHOBJ_UnlockBrush(FillBrushObj); + DC_UnlockDc(dc); + + return ret; +#else + return TRUE; +#endif +} + static BOOL FASTCALL IntArc( DC *dc, int LeftRect, int TopRect, int RightRect, int BottomRect, Modified: trunk/reactos/subsystems/win32/win32k/objects/fillshap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/fillshap.c [iso-8859-1] Sun Jun 8 14:00:50 2008 @@ -391,424 +391,6 @@ DC_UnlockDc(dc); return ret; -} - -typedef struct tagSHAPEPOINT -{ - int X; - int Y; - int Type; -} SHAPEPOINT, *PSHAPEPOINT; - -#define SHAPEPOINT_TYPE_CIRCLE 'C' -#define SHAPEPOINT_TYPE_LINE_RIGHT 'R' /* Fill at right side of line */ -#define SHAPEPOINT_TYPE_LINE_LEFT 'L' /* Fill at left side of line */ - -#define SETPOINT(x, y, type) \ - ShapePoints[*PointCount].X = (x); \ - ShapePoints[*PointCount].Y = (y); \ - ShapePoints[*PointCount].Type = (type); \ - (*PointCount)++ - -#define SETCIRCLEPOINT(x, y) \ - SETPOINT(x, y, SHAPEPOINT_TYPE_CIRCLE) - -#ifdef TODO -STATIC VOID -FASTCALL -CirclePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top, - int Right, int Bottom) -{ - int X, X18, X27, X36, X45; - int Y, Y14, Y23, Y58, Y67; - int d, Radius; - BOOL Even; - - Even = (0 == (Right - Left) % 2); - Right--; - Bottom--; - Radius = (Right - Left) >> 1; - - if (Even) - { - X = 0; - Y = Radius; - d = 2 - Radius; - X18 = Right; - X27 = ((Left + Right) >> 1) + 1; - X36 = (Left + Right) >> 1; - X45 = Left; - Y14 = Top + Radius; - Y23 = Top; - Y58 = Top + Radius + 1; - Y67 = Top + (Right - Left); - ShapePoints[*PointCount].X = X27; - SETCIRCLEPOINT(X27, Y23); - SETCIRCLEPOINT(X36, Y23); - SETCIRCLEPOINT(X18, Y14); - SETCIRCLEPOINT(X45, Y14); - SETCIRCLEPOINT(X18, Y58); - SETCIRCLEPOINT(X45, Y58); - SETCIRCLEPOINT(X27, Y67); - SETCIRCLEPOINT(X36, Y67); - } - else - { - X = 0; - Y = Radius; - d = 1 - Radius; - X18 = Right; - X27 = (Left + Right) >> 1; - X36 = (Left + Right) >> 1; - X45 = Left; - Y14 = Top + Radius; - Y23 = Top; - Y58 = Top + Radius; - Y67 = Top + (Right - Left); - SETCIRCLEPOINT(X27, Y23); - SETCIRCLEPOINT(X45, Y14); - SETCIRCLEPOINT(X18, Y58); - SETCIRCLEPOINT(X27, Y67); - } - - while (X < Y) - { - if (d < 0) - { - d += (X << 1) + (Even ? 4 : 3); - - X27++; - X36--; - Y14--; - Y58++; - } - else - { - d += ((X - Y) << 1) + 5; - Y--; - - Y23++; - Y67--; - X18--; - X45++; - X27++; - X36--; - Y14--; - Y58++; - } - X++; - - SETCIRCLEPOINT(X27, Y23); - SETCIRCLEPOINT(X36, Y23); - SETCIRCLEPOINT(X18, Y14); - SETCIRCLEPOINT(X45, Y14); - SETCIRCLEPOINT(X18, Y58); - SETCIRCLEPOINT(X45, Y58); - SETCIRCLEPOINT(X27, Y67); - SETCIRCLEPOINT(X36, Y67); - } -} - -STATIC VOID -LinePoints(UINT *PointCount, PSHAPEPOINT ShapePoints, int Left, int Top, - int Right, int Bottom, int XTo, int YTo, BOOL Start) -{ - LONG x, y, deltax, deltay, i, xchange, ychange, error; - int Type; - - x = (Right + Left) >> 1; - y = (Bottom + Top) >> 1; - deltax = XTo - x; - deltay = YTo - y; - - if (deltax < 0) - { - xchange = -1; - deltax = - deltax; - x--; - } - else - { - xchange = 1; - } - - if (deltay < 0) - { - ychange = -1; - deltay = - deltay; - y--; - Type = (Start ? SHAPEPOINT_TYPE_LINE_LEFT : SHAPEPOINT_TYPE_LINE_RIGHT); - } - else - { - ychange = 1; - Type = (Start ? SHAPEPOINT_TYPE_LINE_RIGHT : SHAPEPOINT_TYPE_LINE_LEFT); - } - - if (y == YTo) - { - for (i = x; i <= XTo; i++) - { - SETPOINT(i, y, Type); - } - } - else if (x == XTo) - { - for (i = y; i <= YTo; i++) - { - SETPOINT(x, i, Type); - } - } - else - { - error = 0; - - if (deltax < deltay) - { - for (i = 0; i < deltay; i++) - { - SETPOINT(x, y, Type); - y = y + ychange; - error = error + deltax; - - if (deltay <= error) - { - x = x + xchange; - error = error - deltay; - } - } - } - else - { - for (i = 0; i < deltax; i++) - { - SETPOINT(x, y, Type); - x = x + xchange; - error = error + deltay; - if (deltax <= error) - { - y = y + ychange; - error = error - deltax; - } - } - } - } -} - -STATIC int -CDECL -CompareShapePoints(const void *pv1, const void *pv2) -{ - if (((const PSHAPEPOINT) pv1)->Y < ((const PSHAPEPOINT) pv2)->Y) - { - return -1; - } - else if (((const PSHAPEPOINT) pv2)->Y < ((const PSHAPEPOINT) pv1)->Y) - { - return +1; - } - else if (((const PSHAPEPOINT) pv1)->X < ((const PSHAPEPOINT) pv2)->X) - { - return -1; - } - else if (((const PSHAPEPOINT) pv2)->X < ((const PSHAPEPOINT) pv1)->X) - { - return +1; - } - else - { - return 0; - } -} -#endif - - -BOOL -STDCALL -NtGdiPie(HDC hDC, - int Left, - int Top, - int Right, - int Bottom, - int XRadialStart, - int YRadialStart, - int XRadialEnd, - int YRadialEnd) -{ -#ifdef TODO - PDC dc; - PDC_ATTR; - RECTL RectBounds; - SURFOBJ *SurfObj; - BRUSHOBJ PenBrushObj; - PBRUSHOBJ FillBrushObj; - PSHAPEPOINT ShapePoints; - UINT Point, PointCount; - BOOL ret = TRUE; - int Y, CircleStart, CircleEnd, LineStart, LineEnd; - BOOL FullFill; - - if (Right <= Left || Bottom <= Top) - { - SetLastWin32Error(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if (Right - Left != Bottom - Top) - { - UNIMPLEMENTED; - } - - dc = DC_LockDc ( hDC ); - if (NULL == dc) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); - return FALSE; - } - if (dc->DC_Type == DC_TYPE_INFO) - { - DC_UnlockDc(dc); - /* Yes, Windows really returns TRUE in this case */ - return TRUE; - } - - Dc_Attr = dc->pDc_Attr; - if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - - FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush); - if (NULL == FillBrushObj) - { - DC_UnlockDc(dc); - SetLastWin32Error(ERROR_INTERNAL_ERROR); - return FALSE; - } - - Left += dc->ptlDCOrig.x; - Right += dc->ptlDCOrig.x; - Top += dc->ptlDCOrig.y; - Bottom += dc->ptlDCOrig.y; - XRadialStart += dc->ptlDCOrig.x; - YRadialStart += dc->ptlDCOrig.y; - XRadialEnd += dc->ptlDCOrig.x; - YRadialEnd += dc->ptlDCOrig.y; - - RectBounds.left = Left; - RectBounds.right = Right; - RectBounds.top = Top; - RectBounds.bottom = Bottom; - - SurfObj = (SURFOBJ*) AccessUserObject((ULONG)dc->Surface); - HPenToBrushObj(&PenBrushObj, Dc_Attr->hpen); - - /* Number of points for the circle is 4 * sqrt(2) * Radius, start - and end line have at most Radius points, so allocate at least - that much */ - ShapePoints = ExAllocatePoolWithTag(PagedPool, 8 * (Right - Left + 1) / 2 * sizeof(SHAPEPOINT), TAG_SHAPE); - if (NULL == ShapePoints) - { - BRUSHOBJ_UnlockBrush(FillBrushObj); - DC_UnlockDc(dc); - - SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - if (Left == Right) - { - PUTPIXEL(Left, Top, &PenBrushObj); - BRUSHOBJ_UnlockBrush(FillBrushObj); - DC_UnlockDc(dc); - - return ret; - } - - PointCount = 0; - CirclePoints(&PointCount, ShapePoints, Left, Top, Right, Bottom); - LinePoints(&PointCount, ShapePoints, Left, Top, Right, Bottom, - XRadialStart, YRadialStart, TRUE); - LinePoints(&PointCount, ShapePoints, Left, Top, Right, Bottom, - XRadialEnd, YRadialEnd, FALSE); - ASSERT(PointCount <= 8 * (Right - Left + 1) / 2); - EngSort((PBYTE) ShapePoints, sizeof(SHAPEPOINT), PointCount, CompareShapePoints); - - FullFill = TRUE; - Point = 0; - while (Point < PointCount) - { - Y = ShapePoints[Point].Y; - - /* Skip any line pixels before circle */ - while (Point < PointCount && ShapePoints[Point].Y == Y - && SHAPEPOINT_TYPE_CIRCLE != ShapePoints[Point].Type) - { - Point++; - } - - /* Handle left side of circle */ - if (Point < PointCount && ShapePoints[Point].Y == Y) - { - CircleStart = ShapePoints[Point].X; - Point++; - while (Point < PointCount && ShapePoints[Point].Y == Y - && ShapePoints[Point].X == ShapePoints[Point - 1].X + 1 - && SHAPEPOINT_TYPE_CIRCLE == ShapePoints[Point].Type) - { - Point++; - } - CircleEnd = ShapePoints[Point - 1].X; - - PUTLINE(CircleStart, Y, CircleEnd + 1, Y, &PenBrushObj); - } - - /* Handle line(s) (max 2) inside the circle */ - while (Point < PointCount && ShapePoints[Point].Y == Y - && SHAPEPOINT_TYPE_CIRCLE != ShapePoints[Point].Type) - { - LineStart = ShapePoints[Point].X; - Point++; - while (Point < PointCount && ShapePoints[Point].Y == Y - && ShapePoints[Point].X == ShapePoints[Point - 1].X + 1 - && ShapePoints[Point].Type == ShapePoints[Point - 1].Type) - { - Point++; - } - LineEnd = ShapePoints[Point - 1].X; - - PUTLINE(LineStart, Y, LineEnd + 1, Y, &PenBrushObj); - } - - /* Handle right side of circle */ - while (Point < PointCount && ShapePoints[Point].Y == Y - && SHAPEPOINT_TYPE_CIRCLE == ShapePoints[Point].Type) - { - CircleStart = ShapePoints[Point].X; - Point++; - while (Point < PointCount && ShapePoints[Point].Y == Y - && ShapePoints[Point].X == ShapePoints[Point - 1].X + 1 - && SHAPEPOINT_TYPE_CIRCLE == ShapePoints[Point].Type) - { - Point++; - } - CircleEnd = ShapePoints[Point - 1].X; - - PUTLINE(CircleStart, Y, CircleEnd + 1, Y, &PenBrushObj); - } - - /* Skip any line pixels after circle */ - while (Point < PointCount && ShapePoints[Point].Y == Y) - { - Point++; - } - } - - ExFreePool(ShapePoints); - BRUSHOBJ_UnlockBrush(FillBrushObj); - DC_UnlockDc(dc); - - return ret; -#else - return TRUE; -#endif } #if 0
16 years, 6 months
1
0
0
0
[fireball] 33905: - Update dciddi.h header based on Magnus's patch. - Fix dciman32.dll compilation.
by fireball@svn.reactos.org
Author: fireball Date: Sun Jun 8 13:26:22 2008 New Revision: 33905 URL:
http://svn.reactos.org/svn/reactos?rev=33905&view=rev
Log: - Update dciddi.h header based on Magnus's patch. - Fix dciman32.dll compilation. Modified: trunk/reactos/dll/win32/dciman32/dciman_main.c trunk/reactos/include/psdk/dciddi.h Modified: trunk/reactos/dll/win32/dciman32/dciman_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dciman32/dciman_…
============================================================================== --- trunk/reactos/dll/win32/dciman32/dciman_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dciman32/dciman_main.c [iso-8859-1] Sun Jun 8 13:26:22 2008 @@ -22,9 +22,7 @@ #include <stdarg.h> #include <stdio.h> -#include "windef.h" -#include "winbase.h" -#include "winerror.h" +#include "windows.h" #include "dciman.h" #include "wine/debug.h" Modified: trunk/reactos/include/psdk/dciddi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/dciddi.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/dciddi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/dciddi.h [iso-8859-1] Sun Jun 8 13:26:22 2008 @@ -2,6 +2,7 @@ * DCI driver interface * * Copyright (C) 2001 Ove Kaaven + * Copyright (C) 2008 Magnus Olsen, Aleksey Bragin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,8 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __WINE_DCIDDI_H -#define __WINE_DCIDDI_H +#ifndef __INC_DCIDDI +#define __INC_DCIDDI #ifdef __cplusplus extern "C" { @@ -35,15 +36,81 @@ #define DCIENUMSURFACE 4 #define DCIESCAPE 5 -/* DCI Errors */ -#define DCI_OK 0 +typedef int DCIRVAL; /* DCI callback return type */ + +/* DCI Errors and success codes*/ +#define DCI_SUCCESS(error) (((DCIRVAL)error) >= 0) + +#define DCI_STATUS_POINTERCHANGED 1 +#define DCI_STATUS_STRIDECHANGED 2 +#define DCI_STATUS_FORMATCHANGED 4 +#define DCI_STATUS_SURFACEINFOCHANGED 8 +#define DCI_STATUS_CHROMAKEYCHANGED 16 +#define DCI_STATUS_WASSTILLDRAWING 32 + +#define DCI_OK 0 #define DCI_FAIL_GENERIC -1 #define DCI_FAIL_UNSUPPORTEDVERSION -2 #define DCI_FAIL_INVALIDSURFACE -3 #define DCI_FAIL_UNSUPPORTED -4 +#define DCI_ERR_CURRENTLYNOTAVAIL -5 +#define DCI_ERR_INVALIDRECT -6 +#define DCI_ERR_UNSUPPORTEDFORMAT -7 +#define DCI_ERR_UNSUPPORTEDMASK -8 +#define DCI_ERR_TOOBIGHEIGHT -9 +#define DCI_ERR_TOOBIGWIDTH -10 +#define DCI_ERR_TOOBIGSIZE -11 +#define DCI_ERR_OUTOFMEMORY -12 +#define DCI_ERR_INVALIDPOSITION -13 +#define DCI_ERR_INVALIDSTRETCH -14 +#define DCI_ERR_INVALIDCLIPLIST -15 +#define DCI_ERR_SURFACEISOBSCURED -16 +#define DCI_ERR_XALIGN -17 +#define DCI_ERR_YALIGN -18 +#define DCI_ERR_XYALIGN -19 +#define DCI_ERR_WIDTHALIGN -20 +#define DCI_ERR_HEIGHTALIGN -21 -typedef int DCIRVAL; /* DCI callback return type */ +/* Capabilities */ +#define DCI_SURFACE_TYPE 0x0000000F +#define DCI_PRIMARY 0x00000000 +#define DCI_OFFSCREEN 0x00000001 +#define DCI_OVERLAY 0x00000002 +#define DCI_VISIBLE 0x00000010 +#define DCI_CHROMAKEY 0x00000020 +#define DCI_1632_ACCESS 0x00000040 +#define DCI_DWORDSIZE 0x00000080 +#define DCI_DWORDALIGN 0x00000100 +#define DCI_WRITEONLY 0x00000200 +#define DCI_ASYNC 0x00000400 +#define DCI_CAN_STRETCHX 0x00001000 +#define DCI_CAN_STRETCHY 0x00002000 +#define DCI_CAN_STRETCHXY (DCI_CAN_STRETCHX | DCI_CAN_STRETCHY) +#define DCI_CAN_STRETCHXN 0x00004000 +#define DCI_CAN_STRETCHYN 0x00008000 +#define DCI_CAN_STRETCHXYN (DCI_CAN_STRETCHXN | DCI_CAN_STRETCHYN) +#define DCI_CANOVERLAY 0x00010000 + +/* FOURCC codes */ +#ifndef YVU9 +#define YVU9 mmioFOURCC('Y','V','U','9') +#endif +#ifndef Y411 +#define Y411 mmioFOURCC('Y','4','1','1') +#endif +#ifndef YUY2 +#define YUY2 mmioFOURCC('Y','U','Y','2') +#endif +#ifndef YVYU +#define YVYU mmioFOURCC('Y','V','Y','U') +#endif +#ifndef UYVY +#define UYVY mmioFOURCC('U','Y','V','Y') +#endif +#ifndef Y211 +#define Y211 mmioFOURCC('Y','2','1','1') +#endif /***************************************************************************** * Escape command structures @@ -54,7 +121,18 @@ DWORD dwParam2; DWORD dwVersion; DWORD dwReserved; -} DCICMD,*LPDCICMD; +} DCICMD; + +typedef struct _DCICREATEINPUT { + DCICMD cmd; + DWORD dwCompression; + DWORD dwMask[3]; + DWORD dwWidth; + DWORD dwHeight; + DWORD dwDCICaps; + DWORD dwBitCount; + LPVOID lpSurface; +} DCICREATEINPUT, *LPDCICREATEINPUT; typedef struct _DCISURFACEINFO { DWORD dwSize; @@ -74,10 +152,34 @@ DCIRVAL (CALLBACK *BeginAccess)(LPVOID, LPRECT); void (CALLBACK *EndAccess)(LPVOID); void (CALLBACK *DestroySurface)(LPVOID); -} DCISURFACEINFO, *LPDCISURFACEINFO; +} DCISURFACEINFO, *LPDCISURFACEINFO, DCIPRIMARY, *LPDCIPRIMARY; + +typedef void (*ENUM_CALLBACK)(LPDCISURFACEINFO lpSurfaceInfo, + LPVOID lpContext); + +typedef struct _DCIENUMINPUT { + DCICMD cmd; + RECT rSrc; + RECT rDst; + void (CALLBACK *EnumCallback)(LPDCISURFACEINFO, LPVOID); + LPVOID lpContext; +} DCIENUMINPUT, *LPDCIENUMINPUT; + +typedef struct _DCIOFFSCREEN { + DCISURFACEINFO dciInfo; + DCIRVAL (CALLBACK *Draw) (LPVOID); + DCIRVAL (CALLBACK *SetClipList) (LPVOID, LPRGNDATA); + DCIRVAL (CALLBACK *SetDestination) (LPVOID, LPRECT, LPRECT); +} DCIOFFSCREEN, *LPDCIOFFSCREEN; + +typedef struct _DCIOVERLAY { + DCISURFACEINFO dciInfo; + DWORD dwChromakeyValue; + DWORD dwChromakeyMask; +} DCIOVERLAY, *LPDCIOVERLAY; #ifdef __cplusplus } /* extern "C" */ #endif -#endif /* __WINE_DCIDDI_H */ +#endif /* __INC_DCIDDI */
16 years, 6 months
1
0
0
0
[pschweitzer] 33904: Synced shlwapi_winetest.exe with Wine HEAD
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jun 8 12:14:50 2008 New Revision: 33904 URL:
http://svn.reactos.org/svn/reactos?rev=33904&view=rev
Log: Synced shlwapi_winetest.exe with Wine HEAD Modified: trunk/rostests/winetests/shlwapi/istream.c trunk/rostests/winetests/shlwapi/shlwapi.rbuild trunk/rostests/winetests/shlwapi/string.c Modified: trunk/rostests/winetests/shlwapi/istream.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/istream…
============================================================================== --- trunk/rostests/winetests/shlwapi/istream.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/istream.c [iso-8859-1] Sun Jun 8 12:14:50 2008 @@ -197,9 +197,14 @@ IStream * stream; HRESULT ret; ULONG refcount; - static const char * test_file = "c:\\test.txt"; + char test_file[MAX_PATH]; + static const CHAR testA_txt[] = "\\testA.txt"; trace("SHCreateStreamOnFileA: testing mode %d, STGM flags %08x\n", mode, stgm); + + /* Don't used a fixed path for the testA.txt file */ + GetTempPathA(MAX_PATH, test_file); + lstrcatA(test_file, testA_txt); /* invalid arguments */ @@ -284,9 +289,14 @@ IStream * stream; HRESULT ret; ULONG refcount; - static const WCHAR test_file[] = { 'c', ':', '\\', 't', 'e', 's', 't', '.', 't', 'x', 't', '\0' }; + WCHAR test_file[MAX_PATH]; + static const WCHAR testW_txt[] = { '\\', 't', 'e', 's', 't', 'W', '.', 't', 'x', 't', '\0' }; trace("SHCreateStreamOnFileW: testing mode %d, STGM flags %08x\n", mode, stgm); + + /* Don't used a fixed path for the testW.txt file */ + GetTempPathW(MAX_PATH, test_file); + lstrcatW(test_file, testW_txt); /* invalid arguments */ Modified: trunk/rostests/winetests/shlwapi/shlwapi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/shlwapi…
============================================================================== --- trunk/rostests/winetests/shlwapi/shlwapi.rbuild [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/shlwapi.rbuild [iso-8859-1] Sun Jun 8 12:14:50 2008 @@ -16,12 +16,12 @@ <file>url.c</file> <file>testlist.c</file> <library>wine</library> + <library>uuid</library> <library>shlwapi</library> <library>advapi32</library> <library>ole32</library> <library>oleaut32</library> <library>kernel32</library> - <library>uuid</library> <library>ntdll</library> </module> </group> Modified: trunk/rostests/winetests/shlwapi/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/string.…
============================================================================== --- trunk/rostests/winetests/shlwapi/string.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shlwapi/string.c [iso-8859-1] Sun Jun 8 12:14:50 2008 @@ -957,4 +957,6 @@ test_SHAnsiToAnsi(); test_SHUnicodeToUnicode(); test_StrXXX_overflows(); -} + + CoUninitialize(); +}
16 years, 6 months
1
0
0
0
[pschweitzer] 33903: SySynced shlwapi.dll with Wine HEAD
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Jun 8 12:13:54 2008 New Revision: 33903 URL:
http://svn.reactos.org/svn/reactos?rev=33903&view=rev
Log: SySynced shlwapi.dll with Wine HEAD Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc (with props) trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc (with props) Modified: trunk/reactos/dll/win32/shlwapi/istream.c trunk/reactos/dll/win32/shlwapi/ordinal.c trunk/reactos/dll/win32/shlwapi/path.c trunk/reactos/dll/win32/shlwapi/reg.c trunk/reactos/dll/win32/shlwapi/resource.h trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild trunk/reactos/dll/win32/shlwapi/shlwapi.rc trunk/reactos/dll/win32/shlwapi/shlwapi_Sv.rc trunk/reactos/dll/win32/shlwapi/string.c trunk/reactos/dll/win32/shlwapi/url.c Modified: trunk/reactos/dll/win32/shlwapi/istream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/istream.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/istream.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/istream.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -119,13 +119,10 @@ TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbRead); - if (!pv) - return STG_E_INVALIDPOINTER; - if (!ReadFile(This->hFile, pv, cb, &dwRead, NULL)) { - ERR("error %d reading file\n", GetLastError()); - return HRESULT_FROM_WIN32(GetLastError()); + WARN("error %d reading file\n", GetLastError()); + return S_FALSE; } if (pcbRead) *pcbRead = dwRead; @@ -142,16 +139,13 @@ TRACE("(%p,%p,0x%08x,%p)\n", This, pv, cb, pcbWritten); - if (!pv) - return STG_E_INVALIDPOINTER; - switch (STGM_ACCESS_MODE(This->dwMode)) { case STGM_WRITE: case STGM_READWRITE: break; default: - return E_FAIL; + return STG_E_ACCESSDENIED; } if (!WriteFile(This->hFile, pv, cb, &dwWritten, NULL)) @@ -176,7 +170,7 @@ IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ dwPos = SetFilePointer(This->hFile, dlibMove.u.LowPart, NULL, dwOrigin); if( dwPos == INVALID_SET_FILE_POINTER ) - return E_FAIL; + return HRESULT_FROM_WIN32(GetLastError()); if (pNewPos) { @@ -224,7 +218,7 @@ pcbWritten->QuadPart = 0; if (!pstm) - return STG_E_INVALIDPOINTER; + return S_OK; IStream_fnCommit(iface, 0); /* If ever buffered, this will be needed */ @@ -418,9 +412,6 @@ *lppStream = NULL; - if (dwMode & STGM_TRANSACTED) - return E_INVALIDARG; - /* Access */ switch (STGM_ACCESS_MODE(dwMode)) { @@ -440,6 +431,9 @@ /* Sharing */ switch (STGM_SHARE_MODE(dwMode)) { + case 0: + dwShare = FILE_SHARE_READ|FILE_SHARE_WRITE; + break; case STGM_SHARE_DENY_READ: dwShare = FILE_SHARE_WRITE; break; @@ -459,7 +453,7 @@ switch(STGM_CREATE_MODE(dwMode)) { case STGM_FAILIFTHERE: - dwCreate = OPEN_EXISTING; + dwCreate = bCreate ? CREATE_NEW : OPEN_EXISTING; break; case STGM_CREATE: dwCreate = CREATE_ALWAYS; @@ -473,12 +467,7 @@ dwAttributes, 0); if(hFile == INVALID_HANDLE_VALUE) - { - HRESULT hRet = (HRESULT)GetLastError(); - if(hRet > 0) - hRet = HRESULT_FROM_WIN32(hRet); - return hRet; - } + return HRESULT_FROM_WIN32(GetLastError()); *lppStream = IStream_Create(lpszPath, hFile, dwMode); @@ -501,6 +490,9 @@ TRACE("(%s,%d,%p)\n", debugstr_w(lpszPath), dwMode, lppStream); if (!lpszPath || !lppStream) + return E_INVALIDARG; + + if ((dwMode & (STGM_CONVERT|STGM_DELETEONRELEASE|STGM_TRANSACTED)) != 0) return E_INVALIDARG; return SHCreateStreamOnFileEx(lpszPath, dwMode, 0, FALSE, NULL, lppStream); @@ -528,7 +520,8 @@ TRACE("(%s,%d,%p)\n", debugstr_a(lpszPath), dwMode, lppStream); if (!lpszPath) - return E_INVALIDARG; + return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); + MultiByteToWideChar(0, 0, lpszPath, -1, szPath, MAX_PATH); return SHCreateStreamOnFileW(szPath, dwMode, lppStream); } Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -62,7 +62,7 @@ BOOL WINAPI SHAboutInfoW(LPWSTR,DWORD); /* - NOTES: Most functions exported by ordinal seem to be superflous. + NOTES: Most functions exported by ordinal seem to be superfluous. The reason for these functions to be there is to provide a wrapper for unicode functions to provide these functions on systems without unicode functions eg. win95/win98. Since we have such functions we just @@ -1492,11 +1492,11 @@ */ BOOL WINAPI SHLoadMenuPopup(HINSTANCE hInst, LPCWSTR szName) { - HMENU hMenu, hSubMenu; + HMENU hMenu; if ((hMenu = LoadMenuW(hInst, szName))) { - if ((hSubMenu = GetSubMenu(hMenu, 0))) + if (GetSubMenu(hMenu, 0)) RemoveMenu(hMenu, 0, MF_BYPOSITION); DestroyMenu(hMenu); @@ -1959,7 +1959,7 @@ /************************************************************************* * @ [SHLWAPI.198] * - * Return the value asociated with a key in a map. + * Return the value associated with a key in a map. * * PARAMS * lpKeys [I] A list of keys of length iLen @@ -2101,7 +2101,7 @@ /************************************************************************* * @ [SHLWAPI.208] * - * Initialize an FDSA arrary. + * Initialize an FDSA array. */ BOOL WINAPI FDSA_Initialize(DWORD block_size, DWORD inc, FDSA_info *info, void *mem, DWORD init_blocks) @@ -2543,7 +2543,7 @@ * NOTES * This function is used by the native SHRestricted function to search for the * policy and cache it once retrieved. The current Wine implementation uses a - * different POLICYDATA structure and implements a similar algorithme adapted to + * different POLICYDATA structure and implements a similar algorithm adapted to * that structure. */ DWORD WINAPI SHRestrictionLookup( @@ -3433,7 +3433,7 @@ FIXME("Ignoring luma adjustment\n"); - /* FIXME: The ajdustment is not linear */ + /* FIXME: The adjustment is not linear */ cRGB = ColorHLSToRGB(wH, wL, wS); } Modified: trunk/reactos/dll/win32/shlwapi/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/path.c?r…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/path.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -894,7 +894,7 @@ /************************************************************************* * PathQuoteSpacesA [SHLWAPI.@] * - * Surround a path containg spaces in quotes. + * Surround a path containing spaces in quotes. * * PARAMS * lpszPath [I/O] Path to quote @@ -2040,7 +2040,7 @@ * Determine if a path is a file specification. * * PARAMS - * lpszPath [I] Path to chack + * lpszPath [I] Path to check * * RETURNS * TRUE If lpszPath is a file specification (i.e. Contains no directories). @@ -2323,7 +2323,7 @@ * * PARAMS * lpszBuf [O] Output path - * lpszPath [I] Path to cnonicalize + * lpszPath [I] Path to canonicalize * * RETURNS * Success: TRUE. lpszBuf contains the output path, @@ -3344,7 +3344,7 @@ * * RETURNS * TRUE If a relative path can be formed. lpszPath contains the new path - * FALSE If the paths are not relavtive or any parameters are invalid + * FALSE If the paths are not relative or any parameters are invalid * * NOTES * lpszTo should be at least MAX_PATH in length. Modified: trunk/reactos/dll/win32/shlwapi/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/reg.c?re…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/reg.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -215,7 +215,7 @@ * pszPath [I] Key name to create or open. * samDesired [I] Wanted security access. * hRelativeUSKey [I] Base path if pszPath is relative. NULL otherwise. - * phNewUSKey [O] Receives a handle to the new or openened key. + * phNewUSKey [O] Receives a handle to the new or opened key. * dwFlags [I] Base key under which the key should be opened. * * RETURNS @@ -626,7 +626,6 @@ BOOL fIgnoreHKCU, /* [I] TRUE=Don't check HKEY_CURRENT_USER */ BOOL fDefault) /* [I] Default value to use if pszValue is not present */ { - LONG retvalue; DWORD type, datalen, work; BOOL ret = fDefault; CHAR data[10]; @@ -636,9 +635,9 @@ (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM"); datalen = sizeof(data)-1; - if (!(retvalue = SHRegGetUSValueA( pszSubKey, pszValue, &type, - data, &datalen, - fIgnoreHKCU, 0, 0))) { + if (!SHRegGetUSValueA( pszSubKey, pszValue, &type, + data, &datalen, + fIgnoreHKCU, 0, 0)) { /* process returned data via type into bool */ switch (type) { case REG_SZ: @@ -687,7 +686,6 @@ static const WCHAR wTRUE[]= {'T','R','U','E','\0'}; static const WCHAR wNO[]= {'N','O','\0'}; static const WCHAR wFALSE[]={'F','A','L','S','E','\0'}; - LONG retvalue; DWORD type, datalen, work; BOOL ret = fDefault; WCHAR data[10]; @@ -697,9 +695,9 @@ (fIgnoreHKCU) ? "Ignoring HKCU" : "Tries HKCU then HKLM"); datalen = (sizeof(data)-1) * sizeof(WCHAR); - if (!(retvalue = SHRegGetUSValueW( pszSubKey, pszValue, &type, - data, &datalen, - fIgnoreHKCU, 0, 0))) { + if (!SHRegGetUSValueW( pszSubKey, pszValue, &type, + data, &datalen, + fIgnoreHKCU, 0, 0)) { /* process returned data via type into bool */ switch (type) { case REG_SZ: Modified: trunk/reactos/dll/win32/shlwapi/resource.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/resource…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/resource.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/resource.h [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -25,7 +25,7 @@ #define IDS_TIME_INTERVAL_MINUTES 66 #define IDS_TIME_INTERVAL_SECONDS 67 -/* These numbers match native ID's and shouldn't be abitrarily changed */ +/* These numbers match native ID's and shouldn't be arbitrarily changed */ #define IDD_ERR_DIALOG 0x1200 #define IDS_ERR_USER_MSG 0x1201 #define IDC_ERR_DONT_SHOW 0x1202 Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.rbuild [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -25,6 +25,7 @@ <file>shlwapi.rc</file> <file>shlwapi.spec</file> <library>wine</library> + <library>uuid</library> <library>user32</library> <library>gdi32</library> <library>advapi32</library> @@ -39,7 +40,6 @@ <library>shell32</library> <library>winmm</library> <library>version</library> - <library>uuid</library> <library>ntdll</library> </module> </group> Modified: trunk/reactos/dll/win32/shlwapi/shlwapi.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi.…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi.rc [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -25,6 +25,7 @@ #include "version.rc" +#include "shlwapi_Da.rc" #include "shlwapi_De.rc" #include "shlwapi_En.rc" #include "shlwapi_Eo.rc" @@ -41,6 +42,7 @@ #include "shlwapi_Pt.rc" #include "shlwapi_Ro.rc" #include "shlwapi_Ru.rc" +#include "shlwapi_Si.rc" #include "shlwapi_Sv.rc" #include "shlwapi_Tr.rc" #include "shlwapi_Uk.rc" Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc (added) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -1,0 +1,43 @@ +/* + * English resources for shlwapi + * + * Copyright 2008 Jens Albretsen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_DANISH, SUBLANG_DEFAULT + +IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Fejl!" +FONT 8, "MS Shell Dlg" +{ + LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 + LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 + CHECKBOX "Vis ikke denne besked igen", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&OK" IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Annuller" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Ja" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Nej" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bytes" + IDS_TIME_INTERVAL_HOURS " hr" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sec" +} Propchange: trunk/reactos/dll/win32/shlwapi/shlwapi_Da.rc ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc (added) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -1,0 +1,47 @@ +/* + * Slovenian resources for shlwapi + * + * Copyright 2008 Rok Mandeljc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma code_page(65001) + +LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT + +IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Napak!" +FONT 8, "MS Shell Dlg" +{ + LTEXT "", IDS_ERR_USER_MSG2, 15, 5, 28, 20 + LTEXT "", IDS_ERR_USER_MSG, 15, 5, 210, 8 + CHECKBOX "Tega sporoÄila ne &kaži veÄ", IDC_ERR_DONT_SHOW, 5, 20, 210, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&V redu" IDOK, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&PrekliÄi" IDCANCEL, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Da" IDYES, 105, 40, 50, 14, WS_GROUP | WS_TABSTOP + PUSHBUTTON L"&Ne" IDNO, 160, 40, 50, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_BYTES_FORMAT "%ld bajtov" + IDS_TIME_INTERVAL_HOURS " ur" + IDS_TIME_INTERVAL_MINUTES " min" + IDS_TIME_INTERVAL_SECONDS " sek" +} + +#pragma code_page(default) Propchange: trunk/reactos/dll/win32/shlwapi/shlwapi_Si.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_Sv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/shlwapi_Sv.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/shlwapi_Sv.rc [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT +LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL IDD_ERR_DIALOG DIALOG MOVEABLE DISCARDABLE 0, 0, 220, 60 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU Modified: trunk/reactos/dll/win32/shlwapi/string.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/string.c…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/string.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -445,11 +445,11 @@ /************************************************************************* * StrCatW [SHLWAPI.@] * - * Concatanate two strings. + * Concatenate two strings. * * PARAMS * lpszStr [O] Initial string - * lpszSrc [I] String to concatanate + * lpszSrc [I] String to concatenate * * RETURNS * lpszStr. Modified: trunk/reactos/dll/win32/shlwapi/url.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?re…
============================================================================== --- trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] Sun Jun 8 12:13:54 2008 @@ -750,7 +750,7 @@ } process_case = 1; break; - } while(FALSE); /* a litte trick to allow easy exit from nested if's */ + } while(FALSE); /* a little trick to allow easy exit from nested if's */ ret = S_OK; switch (process_case) { @@ -2153,7 +2153,6 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) { PARSEDURLA base; - DWORD res1; TRACE("%s\n", debugstr_a(lpstrPath)); @@ -2161,7 +2160,7 @@ /* get protocol */ base.cbSize = sizeof(base); - res1 = ParseURLA(lpstrPath, &base); + ParseURLA(lpstrPath, &base); return (base.nScheme != URL_SCHEME_INVALID); } @@ -2173,7 +2172,6 @@ BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath) { PARSEDURLW base; - DWORD res1; TRACE("%s\n", debugstr_w(lpstrPath)); @@ -2181,7 +2179,7 @@ /* get protocol */ base.cbSize = sizeof(base); - res1 = ParseURLW(lpstrPath, &base); + ParseURLW(lpstrPath, &base); return (base.nScheme != URL_SCHEME_INVALID); } @@ -2312,7 +2310,7 @@ * dwDestLen [I] Length of lpszDest * * RETURNS - * Success: S_OK. lpszDest constains the resource Url. + * Success: S_OK. lpszDest contains the resource Url. * Failure: E_INVALIDARG, if any argument is invalid, or * E_FAIL if dwDestLen is too small. */
16 years, 6 months
1
0
0
0
[dchapyshev] 33902: - Remove duplicate code - Fix formatting - Add checking parameters for more functions
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Jun 8 10:04:00 2008 New Revision: 33902 URL:
http://svn.reactos.org/svn/reactos?rev=33902&view=rev
Log: - Remove duplicate code - Fix formatting - Add checking parameters for more functions Modified: trunk/reactos/dll/win32/kernel32/misc/lang.c Modified: trunk/reactos/dll/win32/kernel32/misc/lang.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/la…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/lang.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/lang.c [iso-8859-1] Sun Jun 8 10:04:00 2008 @@ -1,4 +1,4 @@ -/* $Id$ +/* * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -11,6 +11,7 @@ * Alex Ionescu * Richard Campbell * James Tabor + * Dmitry Chapyshev * UPDATE HISTORY: * Created 21/09/2003 */ @@ -281,7 +282,7 @@ HANDLE hkey; RtlInitUnicodeString( &keyName, szKeyName ); - InitializeObjectAttributes(&attr, &keyName, 0, hRootKey, NULL); + InitializeObjectAttributes(&attr, &keyName, OBJ_CASE_INSENSITIVE, hRootKey, NULL); if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr ) != STATUS_SUCCESS) hkey = 0; @@ -527,6 +528,80 @@ } +/* Callback function ptrs for EnumSystemCodePagesA/W */ +typedef struct +{ + CODEPAGE_ENUMPROCA procA; + CODEPAGE_ENUMPROCW procW; + DWORD dwFlags; +} ENUMSYSTEMCODEPAGES_CALLBACKS; + +/* Internal implementation of EnumSystemCodePagesA/W */ +static BOOL NLS_EnumSystemCodePages(ENUMSYSTEMCODEPAGES_CALLBACKS *lpProcs) +{ + WCHAR szNumber[5 + 1], szValue[MAX_PATH]; + HANDLE hKey; + BOOL bContinue = TRUE; + ULONG ulIndex = 0; + + if (!lpProcs) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + switch (lpProcs->dwFlags) + { + case CP_INSTALLED: + case CP_SUPPORTED: + break; + default: + SetLastError(ERROR_INVALID_FLAGS); + return FALSE; + } + + hKey = NLS_RegOpenKey(0, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage"); + if (!hKey) + { + DPRINT1("NLS_RegOpenKey() failed\n"); + return FALSE; + } + + while (bContinue) + { + if (NLS_RegEnumValue(hKey, ulIndex, szNumber, sizeof(szNumber), + szValue, sizeof(szValue))) + { + if ((lpProcs->dwFlags == CP_SUPPORTED)|| + ((lpProcs->dwFlags == CP_INSTALLED)&&(wcslen(szValue) > 2))) + { + if (lpProcs->procW) + { + bContinue = lpProcs->procW(szNumber); + } + else + { + char szNumberA[sizeof(szNumber)/sizeof(WCHAR)]; + + WideCharToMultiByte(CP_ACP, 0, szNumber, -1, szNumberA, sizeof(szNumberA), 0, 0); + bContinue = lpProcs->procA(szNumberA); + } + } + + ulIndex++; + + } else bContinue = FALSE; + + if (!bContinue) + break; + } + + if (hKey) + NtClose(hKey); + + return TRUE; +} + /* * @implemented */ @@ -537,54 +612,15 @@ DWORD dwFlags ) { - WCHAR szNumber[5 + 1], szValue[MAX_PATH]; - HKEY hKey; - BOOL bContinue = TRUE; - ULONG ulIndex = 1; - - DPRINT("(%p,0x%08X)\n", lpCodePageEnumProc, dwFlags); - - if ((!dwFlags & CP_INSTALLED)&&(!dwFlags & CP_SUPPORTED)) - { - SetLastError(ERROR_INVALID_FLAGS); - return FALSE; - } - - if (!lpCodePageEnumProc) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - hKey = NLS_RegOpenKey(0, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage"); - if (!hKey) - { - DPRINT1("NLS_RegOpenKey() failed\n"); - return FALSE; - } - - while (bContinue) - { - if (NLS_RegEnumValue(hKey, ulIndex, szNumber, sizeof(szNumber), - szValue, sizeof(szValue))) - { - if ((dwFlags & CP_SUPPORTED)|| - ((dwFlags & CP_INSTALLED)&&(wcslen(szValue) > 2))) - if (!lpCodePageEnumProc(szNumber)) - break; - - ulIndex++; - - } else bContinue = FALSE; - - if (!bContinue) - break; - } - - if (hKey) - NtClose(hKey); - - return TRUE; + ENUMSYSTEMCODEPAGES_CALLBACKS procs; + + DPRINT("(%p,0x%08X,0x%08lX)\n", lpCodePageEnumProc, dwFlags); + + procs.procA = NULL; + procs.procW = lpCodePageEnumProc; + procs.dwFlags = dwFlags; + + return NLS_EnumSystemCodePages(lpCodePageEnumProc ? &procs : NULL); } @@ -598,58 +634,15 @@ DWORD dwFlags ) { - WCHAR szNumber[5 + 1], szValue[MAX_PATH]; - HKEY hKey; - BOOL bContinue = TRUE; - ULONG ulIndex = 1; - - DPRINT("(%p,0x%08X)\n", lpCodePageEnumProc, dwFlags); - - if ((!dwFlags & CP_INSTALLED)&&(!dwFlags & CP_SUPPORTED)) - { - SetLastError(ERROR_INVALID_FLAGS); - return FALSE; - } - - if (!lpCodePageEnumProc) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - hKey = NLS_RegOpenKey(0, L"\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage"); - if (!hKey) - { - DPRINT1("NLS_RegOpenKey() failed\n"); - return FALSE; - } - - while (bContinue) - { - if (NLS_RegEnumValue(hKey, ulIndex, szNumber, sizeof(szNumber), - szValue, sizeof(szValue))) - { - char szNumberA[sizeof(szNumber)/sizeof(WCHAR)]; - - WideCharToMultiByte(CP_ACP, 0, szNumber, -1, szNumberA, sizeof(szNumberA), 0, 0); - - if ((dwFlags & CP_SUPPORTED)|| - ((dwFlags & CP_INSTALLED)&&(wcslen(szValue) > 1))) - if (!lpCodePageEnumProc(szNumberA)) - break; - - ulIndex++; - - } else bContinue = FALSE; - - if (!bContinue) - break; - } - - if (hKey) - NtClose(hKey); - - return TRUE; + ENUMSYSTEMCODEPAGES_CALLBACKS procs; + + DPRINT("(%p,0x%08X,0x%08lX)\n", lpCodePageEnumProc, dwFlags); + + procs.procA = lpCodePageEnumProc; + procs.procW = NULL; + procs.dwFlags = dwFlags; + + return NLS_EnumSystemCodePages(lpCodePageEnumProc ? &procs : NULL); } @@ -675,7 +668,7 @@ return FALSE; } - hKey = NLS_RegOpenKey(0, L"\\Registry\\Machine\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country List"); + hKey = NLS_RegOpenKey(0, L"\\REGISTRY\\Machine\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country List"); if (!hKey) { DPRINT1("NLS_RegOpenKey() failed\n"); @@ -883,9 +876,9 @@ switch (lpProcs->dwFlags) { + case LCID_ALTERNATE_SORTS: case LCID_INSTALLED: case LCID_SUPPORTED: - case LCID_ALTERNATE_SORTS: break; default: SetLastError(ERROR_INVALID_FLAGS); @@ -1314,7 +1307,7 @@ NTSTATUS Status; int Ret; - swprintf(szPath, L"\\Registry\\Machine\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country List\\%d", Location); + swprintf(szPath, L"\\REGISTRY\\Machine\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Country List\\%d", Location); hKey = NLS_RegOpenKey(0, szPath); if (!hKey) @@ -1389,7 +1382,7 @@ int cchData, LANGID LangId) { - DPRINT1("%d %d %p %d %d\n", Location, GeoType, lpGeoData, cchData, LangId); + DPRINT("%d %d %p %d %d\n", Location, GeoType, lpGeoData, cchData, LangId); if ((GeoType == GEO_TIMEZONES)||(GeoType == GEO_OFFICIALLANGUAGES)) { @@ -1430,7 +1423,7 @@ int cchData, LANGID LangId) { - DPRINT1("%d %d %p %d %d\n", Location, GeoType, lpGeoData, cchData, LangId); + DPRINT("%d %d %p %d %d\n", Location, GeoType, lpGeoData, cchData, LangId); if ((GeoType == GEO_TIMEZONES)||(GeoType == GEO_OFFICIALLANGUAGES)) { @@ -1792,69 +1785,69 @@ if (String1 && String2) { - len1 = String1->Length / sizeof(WCHAR); - len2 = String2->Length / sizeof(WCHAR); - s1 = String1->Buffer; - s2 = String2->Buffer; - - while (len1 > 0 && len2 > 0) - { - if (Flags & NORM_IGNORESYMBOLS) + len1 = String1->Length / sizeof(WCHAR); + len2 = String2->Length / sizeof(WCHAR); + s1 = String1->Buffer; + s2 = String2->Buffer; + + while (len1 > 0 && len2 > 0) { - int skip = 0; - /* FIXME: not tested */ - if (iswctype(*s1, _SPACE | _PUNCT)) + if (Flags & NORM_IGNORESYMBOLS) { - s1++; - len1--; - skip = 1; - } - if (iswctype(*s2, _SPACE | _PUNCT)) - { - s2++; - len2--; - skip = 1; - } - if (skip) continue; - } - - /* hyphen and apostrophe are treated differently depending on - * whether SORT_STRINGSORT specified or not - */ - if (!(Flags & SORT_STRINGSORT)) - { - if (*s1 == '-' || *s1 == '\'') - { - if (*s2 != '-' && *s2 != '\'') + int skip = 0; + /* FIXME: not tested */ + if (iswctype(*s1, _SPACE | _PUNCT)) { s1++; len1--; + skip = 1; + } + if (iswctype(*s2, _SPACE | _PUNCT)) + { + s2++; + len2--; + skip = 1; + } + if (skip) continue; + } + + /* hyphen and apostrophe are treated differently depending on + * whether SORT_STRINGSORT specified or not + */ + if (!(Flags & SORT_STRINGSORT)) + { + if (*s1 == '-' || *s1 == '\'') + { + if (*s2 != '-' && *s2 != '\'') + { + s1++; + len1--; + continue; + } + } + else if (*s2 == '-' || *s2 == '\'') + { + s2++; + len2--; continue; } } - else if (*s2 == '-' || *s2 == '\'') + if (Flags & NORM_IGNORECASE) { - s2++; - len2--; - continue; + c1 = len1-- ? RtlUpcaseUnicodeChar(*s1++) : 0; + c2 = len2-- ? RtlUpcaseUnicodeChar(*s2++) : 0; + if (!c1 || !c2 || c1 != c2) + return c1 - c2; + } + else + { + c1 = len1-- ? *s1++ : 0; + c2 = len2-- ? *s2++ : 0; + if (!c1 || !c2 || c1 != c2) + return c1 - c2; } } - if (Flags & NORM_IGNORECASE) - { - c1 = len1-- ? RtlUpcaseUnicodeChar(*s1++) : 0; - c2 = len2-- ? RtlUpcaseUnicodeChar(*s2++) : 0; - if (!c1 || !c2 || c1 != c2) - return c1 - c2; - } - else - { - c1 = len1-- ? *s1++ : 0; - c2 = len2-- ? *s2++ : 0; - if (!c1 || !c2 || c1 != c2) - return c1 - c2; - } - } - return (int) len1 - (int) len2; + return (int) len1 - (int) len2; } return 0; } @@ -1994,7 +1987,7 @@ LANGID STDCALL GetSystemDefaultLangID(VOID) { - return LANGIDFROMLCID(GetSystemDefaultLCID()); + return LANGIDFROMLCID(GetSystemDefaultLCID()); } @@ -2004,11 +1997,11 @@ LCID STDCALL GetSystemDefaultLCID(VOID) { - LCID lcid; - - NtQueryDefaultLocale(FALSE, &lcid); - - return lcid; + LCID lcid; + + NtQueryDefaultLocale(FALSE, &lcid); + + return lcid; } @@ -2018,17 +2011,17 @@ LANGID STDCALL GetSystemDefaultUILanguage(VOID) { - LANGID LanguageId; - NTSTATUS Status; - - Status = NtQueryInstallUILanguage(&LanguageId); - if (!NT_SUCCESS(Status)) + LANGID LanguageId; + NTSTATUS Status; + + Status = NtQueryInstallUILanguage(&LanguageId); + if (!NT_SUCCESS(Status)) { SetLastErrorByStatus(Status); return 0; } - return LanguageId; + return LanguageId; } @@ -2038,7 +2031,7 @@ LCID STDCALL GetThreadLocale(VOID) { - return NtCurrentTeb()->CurrentLocale; + return NtCurrentTeb()->CurrentLocale; } @@ -2048,7 +2041,7 @@ LANGID STDCALL GetUserDefaultLangID(VOID) { - return LANGIDFROMLCID(GetUserDefaultLCID()); + return LANGIDFROMLCID(GetUserDefaultLCID()); } @@ -2058,14 +2051,14 @@ LCID STDCALL GetUserDefaultLCID(VOID) { - LCID lcid; - NTSTATUS Status; - - Status = NtQueryDefaultLocale(TRUE, &lcid); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return 0; + LCID lcid; + NTSTATUS Status; + + Status = NtQueryDefaultLocale(TRUE, &lcid); + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return 0; } return lcid; @@ -2078,17 +2071,17 @@ LANGID STDCALL GetUserDefaultUILanguage(VOID) { - LANGID LangId; - NTSTATUS Status; - - Status = NtQueryDefaultUILanguage(&LangId); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return 0; - } - - return LangId; + LANGID LangId; + NTSTATUS Status; + + Status = NtQueryDefaultUILanguage(&LangId); + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return 0; + } + + return LangId; } @@ -2185,7 +2178,7 @@ { static const WCHAR szFormat[] = { '%','x','\0' }; UNICODE_STRING szNlsKeyName = - RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Nls"); + RTL_CONSTANT_STRING(L"\\REGISTRY\\Machine\\System\\CurrentControlSet\\Control\\Nls"); UNICODE_STRING szLangGroupsKeyName = RTL_CONSTANT_STRING(L"Language Groups"); const int MAX_VALUE_NAME = 16; @@ -2285,103 +2278,103 @@ IsValidLocale(LCID Locale, DWORD dwFlags) { - OBJECT_ATTRIBUTES ObjectAttributes; - PKEY_VALUE_PARTIAL_INFORMATION KeyInfo; - WCHAR ValueNameBuffer[9]; - UNICODE_STRING KeyName; - UNICODE_STRING ValueName; - ULONG KeyInfoSize; - ULONG ReturnedSize; - HANDLE KeyHandle; - PWSTR ValueData; - NTSTATUS Status; - - DPRINT("IsValidLocale() called\n"); - - if ((dwFlags & ~(LCID_SUPPORTED | LCID_INSTALLED)) || - (dwFlags == (LCID_SUPPORTED | LCID_INSTALLED))) - { - DPRINT("Invalid flags: %lx\n", dwFlags); - return FALSE; - } - - if (Locale & 0xFFFF0000) - { - RtlInitUnicodeString(&KeyName, - L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Locale\\Alternate Sorts"); - } - else - { - RtlInitUnicodeString(&KeyName, - L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Locale"); - } - - InitializeObjectAttributes(&ObjectAttributes, + OBJECT_ATTRIBUTES ObjectAttributes; + PKEY_VALUE_PARTIAL_INFORMATION KeyInfo; + WCHAR ValueNameBuffer[9]; + UNICODE_STRING KeyName; + UNICODE_STRING ValueName; + ULONG KeyInfoSize; + ULONG ReturnedSize; + HANDLE KeyHandle; + PWSTR ValueData; + NTSTATUS Status; + + DPRINT("IsValidLocale() called\n"); + + if ((dwFlags & ~(LCID_SUPPORTED | LCID_INSTALLED)) || + (dwFlags == (LCID_SUPPORTED | LCID_INSTALLED))) + { + DPRINT("Invalid flags: %lx\n", dwFlags); + return FALSE; + } + + if (Locale & 0xFFFF0000) + { + RtlInitUnicodeString(&KeyName, + L"\\REGISTRY\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Locale\\Alternate Sorts"); + } + else + { + RtlInitUnicodeString(&KeyName, + L"\\REGISTRY\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Nls\\Locale"); + } + + InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE, NULL, NULL); - Status = NtOpenKey(&KeyHandle, + Status = NtOpenKey(&KeyHandle, KEY_QUERY_VALUE, &ObjectAttributes); - if (!NT_SUCCESS(Status)) - { - DPRINT("NtOpenKey() failed (Status %lx)\n", Status); - return FALSE; - } - - swprintf(ValueNameBuffer, L"%08lx", (ULONG)Locale); - RtlInitUnicodeString(&ValueName, ValueNameBuffer); - - KeyInfoSize = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 4 * sizeof(WCHAR); - KeyInfo = RtlAllocateHeap(RtlGetProcessHeap(), + if (!NT_SUCCESS(Status)) + { + DPRINT("NtOpenKey() failed (Status %lx)\n", Status); + return FALSE; + } + + swprintf(ValueNameBuffer, L"%08lx", (ULONG)Locale); + RtlInitUnicodeString(&ValueName, ValueNameBuffer); + + KeyInfoSize = sizeof(KEY_VALUE_PARTIAL_INFORMATION) + 4 * sizeof(WCHAR); + KeyInfo = RtlAllocateHeap(RtlGetProcessHeap(), HEAP_ZERO_MEMORY, KeyInfoSize); - if (KeyInfo == NULL) - { - DPRINT("RtlAllocateHeap() failed (Status %lx)\n", Status); - NtClose(KeyHandle); - return FALSE; - } - - Status = NtQueryValueKey(KeyHandle, + if (KeyInfo == NULL) + { + DPRINT("RtlAllocateHeap() failed (Status %lx)\n", Status); + NtClose(KeyHandle); + return FALSE; + } + + Status = NtQueryValueKey(KeyHandle, &ValueName, KeyValuePartialInformation, KeyInfo, KeyInfoSize, &ReturnedSize); - NtClose(KeyHandle); - - if (!NT_SUCCESS(Status)) - { - DPRINT("NtQueryValueKey() failed (Status %lx)\n", Status); - RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo); - return FALSE; - } - - if (dwFlags & LCID_SUPPORTED) - { - DPRINT("Locale is supported\n"); - RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo); - return TRUE; - } - - ValueData = (PWSTR)&KeyInfo->Data[0]; - if ((KeyInfo->Type == REG_SZ) && - (KeyInfo->DataLength == 2 * sizeof(WCHAR)) && - (ValueData[0] == L'1')) - { - DPRINT("Locale is supported and installed\n"); - RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo); - return TRUE; - } - - RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo); - - DPRINT("IsValidLocale() called\n"); - - return FALSE; + NtClose(KeyHandle); + + if (!NT_SUCCESS(Status)) + { + DPRINT("NtQueryValueKey() failed (Status %lx)\n", Status); + RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo); + return FALSE; + } + + if (dwFlags & LCID_SUPPORTED) + { + DPRINT("Locale is supported\n"); + RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo); + return TRUE; + } + + ValueData = (PWSTR)&KeyInfo->Data[0]; + if ((KeyInfo->Type == REG_SZ) && + (KeyInfo->DataLength == 2 * sizeof(WCHAR)) && + (ValueData[0] == L'1')) + { + DPRINT("Locale is supported and installed\n"); + RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo); + return TRUE; + } + + RtlFreeHeap(RtlGetProcessHeap(), 0, KeyInfo); + + DPRINT("IsValidLocale() called\n"); + + return FALSE; } @@ -2399,6 +2392,12 @@ int cchDest ) { + if (!lpSrcStr || !cchSrc || cchDest < 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return 0; } @@ -2418,6 +2417,24 @@ int cchDest ) { + if (!lpSrcStr || !cchSrc || cchDest < 0) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + /* mutually exclusive flags */ + if ((dwMapFlags & (LCMAP_LOWERCASE | LCMAP_UPPERCASE)) == (LCMAP_LOWERCASE | LCMAP_UPPERCASE) || + (dwMapFlags & (LCMAP_HIRAGANA | LCMAP_KATAKANA)) == (LCMAP_HIRAGANA | LCMAP_KATAKANA) || + (dwMapFlags & (LCMAP_HALFWIDTH | LCMAP_FULLWIDTH)) == (LCMAP_HALFWIDTH | LCMAP_FULLWIDTH) || + (dwMapFlags & (LCMAP_TRADITIONAL_CHINESE | LCMAP_SIMPLIFIED_CHINESE)) == (LCMAP_TRADITIONAL_CHINESE | LCMAP_SIMPLIFIED_CHINESE)) + { + SetLastError(ERROR_INVALID_FLAGS); + return 0; + } + + if (!cchDest) lpDestStr = NULL; + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return 0; } @@ -2432,10 +2449,27 @@ LCID Locale, CALID Calendar, CALTYPE CalType, - LPCSTR lpCalData) -{ + LPCSTR lpCalData) +{ + if (!Locale || !lpCalData) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + switch (CalType) + { + case CAL_NOUSEROVERRIDE: + case CAL_RETURN_NUMBER: + case CAL_USE_CP_ACP: + break; + default: + SetLastError(ERROR_INVALID_FLAGS); + return FALSE; + } + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + return FALSE; } /* @@ -2449,8 +2483,25 @@ CALTYPE CalType, LPCWSTR lpCalData) { + if (!Locale || !lpCalData) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + switch (CalType) + { + case CAL_NOUSEROVERRIDE: + case CAL_RETURN_NUMBER: + case CAL_USE_CP_ACP: + break; + default: + SetLastError(ERROR_INVALID_FLAGS); + return FALSE; + } + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + return FALSE; } @@ -2739,6 +2790,3 @@ { return GetLocaleInfoW( MAKELCID(wLang, SORT_DEFAULT), LOCALE_SENGLANGUAGE, szLang, nSize ); } - - -
16 years, 6 months
1
0
0
0
[ekohl] 33901: - User properties: Fix a memory leak. Enable the Apply button when the users full name or description is changed. - Group properties: The group description can be changed. Update the group list when the group description changes.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jun 8 08:34:42 2008 New Revision: 33901 URL:
http://svn.reactos.org/svn/reactos?rev=33901&view=rev
Log: - User properties: Fix a memory leak. Enable the Apply button when the users full name or description is changed. - Group properties: The group description can be changed. Update the group list when the group description changes. Modified: trunk/reactos/dll/cpl/usrmgr/groupprops.c trunk/reactos/dll/cpl/usrmgr/groups.c trunk/reactos/dll/cpl/usrmgr/userprops.c Modified: trunk/reactos/dll/cpl/usrmgr/groupprops.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/groupprops.…
============================================================================== --- trunk/reactos/dll/cpl/usrmgr/groupprops.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/usrmgr/groupprops.c [iso-8859-1] Sun Jun 8 08:34:42 2008 @@ -61,7 +61,8 @@ static VOID -GetGroupData(HWND hwndDlg, LPTSTR lpGroupName) +GetGeneralGroupData(HWND hwndDlg, + PGENERAL_GROUP_DATA pGroupData) { PLOCALGROUP_INFO_1 groupInfo = NULL; PLOCALGROUP_MEMBERS_INFO_1 membersInfo = NULL; @@ -101,15 +102,15 @@ (void)ListView_InsertColumn(hwndLV, 0, &column); /* Set group name */ - SetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_NAME, lpGroupName); + SetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_NAME, pGroupData->szGroupName); /* Set group description */ - NetLocalGroupGetInfo(NULL, lpGroupName, 1, (LPBYTE*)&groupInfo); + NetLocalGroupGetInfo(NULL, pGroupData->szGroupName, 1, (LPBYTE*)&groupInfo); SetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_DESCRIPTION, groupInfo->lgrpi1_comment); NetApiBufferFree(groupInfo); /* Set group members */ - NetLocalGroupGetMembers(NULL, lpGroupName, 1, (LPBYTE*)&membersInfo, + NetLocalGroupGetMembers(NULL, pGroupData->szGroupName, 1, (LPBYTE*)&membersInfo, MAX_PREFERRED_LENGTH, &dwRead, &dwTotal, &resumeHandle); @@ -130,7 +131,6 @@ wsprintf(szGroupName, TEXT("%s\\%s (%s)"), - membersInfo[i].lgrmi1_name, szSid); @@ -141,6 +141,42 @@ } NetApiBufferFree(membersInfo); +} + + +static BOOL +SetGeneralGroupData(HWND hwndDlg, + PGENERAL_GROUP_DATA pGroupData) +{ + LOCALGROUP_INFO_1 groupInfo; + LPTSTR pszComment = NULL; + INT nLength; + NET_API_STATUS status; + DWORD dwIndex; + + /* Get the group description */ + nLength = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GROUP_GENERAL_DESCRIPTION)); + if (nLength == 0) + { + groupInfo.lgrpi1_comment = NULL; + } + else + { + pszComment = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR)); + GetDlgItemText(hwndDlg, IDC_GROUP_GENERAL_DESCRIPTION, pszComment, nLength + 1); + groupInfo.lgrpi1_comment = pszComment; + } + + status = NetLocalGroupSetInfo(NULL, pGroupData->szGroupName, 1, (LPBYTE)&groupInfo, &dwIndex); + if (status != NERR_Success) + { + DebugPrintf(_T("Status: %lu Index: %lu"), status, dwIndex); + } + + if (pszComment) + HeapFree(GetProcessHeap(), 0, pszComment); + + return TRUE; } @@ -150,21 +186,49 @@ WPARAM wParam, LPARAM lParam) { + PGENERAL_GROUP_DATA pGroupData; + UNREFERENCED_PARAMETER(lParam); UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(hwndDlg); + pGroupData= (PGENERAL_GROUP_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER); + switch (uMsg) { case WM_INITDIALOG: - GetGroupData(hwndDlg, - (LPTSTR)((PROPSHEETPAGE *)lParam)->lParam); + pGroupData = (PGENERAL_GROUP_DATA)HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(GENERAL_GROUP_DATA) + + lstrlen((LPTSTR)((PROPSHEETPAGE *)lParam)->lParam) * sizeof(TCHAR)); + lstrcpy(pGroupData->szGroupName, (LPTSTR)((PROPSHEETPAGE *)lParam)->lParam); + + SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pGroupData); + + GetGeneralGroupData(hwndDlg, + pGroupData); break; case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_GROUP_GENERAL_DESCRIPTION: + if (HIWORD(wParam) == EN_CHANGE) + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + } + break; + + case WM_NOTIFY: + if (((LPPSHNOTIFY)lParam)->hdr.code == PSN_APPLY) + { + SetGeneralGroupData(hwndDlg, pGroupData); + return TRUE; + } break; case WM_DESTROY: + HeapFree(GetProcessHeap(), 0, pGroupData); break; } Modified: trunk/reactos/dll/cpl/usrmgr/groups.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/groups.c?re…
============================================================================== --- trunk/reactos/dll/cpl/usrmgr/groups.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/usrmgr/groups.c [iso-8859-1] Sun Jun 8 08:34:42 2008 @@ -84,6 +84,35 @@ break; } +} + + +static VOID +UpdateGroupProperties(HWND hwndDlg) +{ + TCHAR szGroupName[UNLEN]; + INT iItem; + HWND hwndLV; + NET_API_STATUS status; + PLOCALGROUP_INFO_1 pGroupInfo = NULL; + + hwndLV = GetDlgItem(hwndDlg, IDC_GROUPS_LIST); + iItem = ListView_GetNextItem(hwndLV, -1, LVNI_SELECTED); + if (iItem == -1) + return; + + /* Get the group name */ + ListView_GetItemText(hwndLV, + iItem, 0, + szGroupName, + UNLEN); + + status = NetLocalGroupGetInfo(NULL, szGroupName, 1, (LPBYTE*)&pGroupInfo); + + ListView_SetItemText(hwndLV, iItem, 1, + pGroupInfo->lgrpi1_comment); + + NetApiBufferFree(pGroupInfo); } @@ -461,7 +490,8 @@ break; case IDM_GROUP_PROPERTIES: - GroupProperties(hwndDlg); + if (GroupProperties(hwndDlg) == IDOK) + UpdateGroupProperties(hwndDlg); break; } break; Modified: trunk/reactos/dll/cpl/usrmgr/userprops.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/usrmgr/userprops.c…
============================================================================== --- trunk/reactos/dll/cpl/usrmgr/userprops.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/usrmgr/userprops.c [iso-8859-1] Sun Jun 8 08:34:42 2008 @@ -310,6 +310,9 @@ if (pszFullName) HeapFree(GetProcessHeap(), 0, pszFullName); + if (pszComment) + HeapFree(GetProcessHeap(), 0, pszComment); + NetApiBufferFree(pUserInfo); return (status == NERR_Success); @@ -339,15 +342,21 @@ lstrlen((LPTSTR)((PROPSHEETPAGE *)lParam)->lParam) * sizeof(TCHAR)); lstrcpy(pUserData->szUserName, (LPTSTR)((PROPSHEETPAGE *)lParam)->lParam); + SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pUserData); + GetGeneralUserData(hwndDlg, pUserData); - - SetWindowLongPtr(hwndDlg, DWLP_USER, (INT_PTR)pUserData); break; case WM_COMMAND: switch (LOWORD(wParam)) { + case IDC_USER_GENERAL_FULL_NAME: + case IDC_USER_GENERAL_DESCRIPTION: + if (HIWORD(wParam) == EN_CHANGE) + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + case IDC_USER_GENERAL_FORCE_CHANGE: pUserData->dwPasswordExpired = !pUserData->dwPasswordExpired; UpdateUserOptions(hwndDlg, pUserData, FALSE);
16 years, 6 months
1
0
0
0
[greatlrd] 33900: add dciman32 from my local working three implemted : DCIOpenProvider, DCICloseProvider, DCICreateOffscreen, DCICreateOverlay, DCIDraw, DCISetClipList, DCISetSrcDestClip, DCISetDestination
by greatlrd@svn.reactos.org
Author: greatlrd Date: Sun Jun 8 08:15:47 2008 New Revision: 33900 URL:
http://svn.reactos.org/svn/reactos?rev=33900&view=rev
Log: add dciman32 from my local working three implemted : DCIOpenProvider, DCICloseProvider, DCICreateOffscreen, DCICreateOverlay, DCIDraw, DCISetClipList, DCISetSrcDestClip, DCISetDestination Added: branches/win32k-gdi-dx/dll/win32/dciman32/ branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.def (with props) branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.rbuild (with props) branches/win32k-gdi-dx/dll/win32/dciman32/dciman32_main.c (with props) branches/win32k-gdi-dx/dll/win32/dciman32/precomp.h (with props) Added: branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.def URL:
http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/dciman3…
============================================================================== --- branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.def (added) +++ branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.def [iso-8859-1] Sun Jun 8 08:15:47 2008 @@ -1,0 +1,29 @@ +; $Id: gdi32.def 33598 2008-05-19 10:20:39Z greatlrd $ +; +; gdi32.def +; +; ReactOS Operating System +; dciman32.def. +; +LIBRARY dciman32.dll +EXPORTS +DCIBeginAccess@20 +DCICloseProvider@4 +DCICreateOffscreen@40 +DCICreateOverlay@12 +DCICreatePrimary@8 +DCIDestroy@4 +DCIDraw@4 +DCIEndAccess@4 +DCIEnum@20 +DCIOpenProvider@0 +DCISetClipList@8 +DCISetDestination@12=DCICreateOverlay +DCISetSrcDestClip@16 +GetDCRegionData@12 +GetWindowRegionData@12 +WinWatchClose@4 +WinWatchDidStatusChange@4 +WinWatchGetClipList@16 +WinWatchNotify@12 +WinWatchOpen@4 Propchange: branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.def ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/dciman3…
============================================================================== --- branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.rbuild (added) +++ branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.rbuild [iso-8859-1] Sun Jun 8 08:15:47 2008 @@ -1,0 +1,18 @@ +<module name="dciman32" type="win32dll" baseaddress="${BASEADDRESS_DCIMAN32}" installbase="system32" installname="dciman32.dll" unicode="yes"> + <importlibrary definition="dciman32.def" /> + <include base="dciman32">include</include> + <define name="_DISABLE_TIDENTS" /> + <define name="WINVER">0x0600</define> + <define name="_WIN32_WINNT">0x0501</define> + <library>ntdll</library> + <library>user32</library> + <library>kernel32</library> + <library>advapi32</library> + <library>pseh</library> + <library>dxguid</library> + <library>gdi32</library> + <pch>precomp.h</pch> + <file>dciman32_main.c</file> + +</module> + Propchange: branches/win32k-gdi-dx/dll/win32/dciman32/dciman32.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/win32k-gdi-dx/dll/win32/dciman32/dciman32_main.c URL:
http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/dciman3…
============================================================================== --- branches/win32k-gdi-dx/dll/win32/dciman32/dciman32_main.c (added) +++ branches/win32k-gdi-dx/dll/win32/dciman32/dciman32_main.c [iso-8859-1] Sun Jun 8 08:15:47 2008 @@ -1,0 +1,302 @@ +/* + * Implementation of DCIMAN32 - DCI Manager + */ + +#include <precomp.h> + +BOOL +WINAPI +DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) +{ + return TRUE; +} + + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +DCIRVAL +WINAPI +DCIBeginAccess( + LPDCISURFACEINFO pdci, + int x, + int y, + int dx, + int dy) +{ + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return DCI_FAIL_UNSUPPORTED; +} + + +/* + * @implemented + */ +DCMAIN32SDKAPI +HDC +WINAPI +DCIOpenProvider() +{ + HDC hdc = NULL; + + if ( (GetSystemMetrics(SM_CMONITORS) == 1) || + (GetSystemMetrics(SM_CMONITORS) == 0) ) + { + hdc = CreateDCW(L"DISPLAY",0,0,0); + } + + return hdc; +} + +/* + * @implemented + */ +DCMAIN32SDKAPI +void +WINAPI +DCICloseProvider(HDC hdc) +{ + DeleteDC(hdc); +} + +/* + * @implemented + * Note : DCICreateOffscreen always return DCI_FAIL_UNSUPPORTED what every it u try todo + */ +DCMAIN32SDKAPI +int +WINAPI +DCICreateOffscreen( + HDC hdc, + DWORD dwCompression, + DWORD dwRedMask, + DWORD dwGreenMask, + DWORD dwBlueMask, + DWORD dwWidth, + DWORD dwHeight, + DWORD dwDCICaps, + DWORD dwBitCount, + LPDCIOFFSCREEN FAR *lplpSurface) +{ + return DCI_FAIL_UNSUPPORTED; +} + +/* + * @implemented + * Note : DCICreateOverlay always return DCI_FAIL_UNSUPPORTED what every it u try todo + */ +DCMAIN32SDKAPI +int +WINAPI +DCICreateOverlay( + HDC hdc, + LPVOID lpOffscreenSurf, + LPDCIOVERLAY FAR *lplpSurface) +{ + return DCI_FAIL_UNSUPPORTED; +} + + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +int +WINAPI +DCICreatePrimary( + HDC hdc, + LPDCISURFACEINFO FAR *lplpSurface) +{ + + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return DCI_FAIL_UNSUPPORTED; +} + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +void +WINAPI DCIDestroy(LPDCISURFACEINFO pdci) +{ + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); +} + +/* + * @implemented + * Note : DCIDraw always return DCI_FAIL_UNSUPPORTED what every it u try todo + */ +DCMAIN32SDKAPI +DCIRVAL +WINAPI +DCIDraw(LPDCIOFFSCREEN pdci) +{ + return DCI_FAIL_UNSUPPORTED; +} + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +void +WINAPI +DCIEndAccess(LPDCISURFACEINFO pdci) +{ + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); +} + +/* + * @implemented + * Note : DCIEnum always return DCI_FAIL_UNSUPPORTED what every it u try todo + */ +DCMAIN32SDKAPI +int +WINAPI +DCIEnum( + HDC hdc, + LPRECT lprDst, + LPRECT lprSrc, + LPVOID lpFnCallback, + LPVOID lpContext) +{ + return DCI_FAIL_UNSUPPORTED; +} + +/* + * @implemented + * Note : DCIEnum always return DCI_FAIL_UNSUPPORTED what every it u try todo + */ +DCMAIN32SDKAPI +DCIRVAL +WINAPI +DCISetClipList( + LPDCIOFFSCREEN pdci, + LPRGNDATA prd) +{ + return DCI_FAIL_UNSUPPORTED; +} + +/* + * @unimplemented + * Note : DCIEnum always return DCI_FAIL_UNSUPPORTED what every it u try todo + */ +DCMAIN32SDKAPI +DCIRVAL +WINAPI +DCISetSrcDestClip( + LPDCIOFFSCREEN pdci, + LPRECT srcrc, + LPRECT destrc, + LPRGNDATA prd ) +{ + return DCI_FAIL_UNSUPPORTED; +} + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +DWORD +WINAPI +GetDCRegionData( + HDC hdc, + DWORD size, + LPRGNDATA prd) +{ + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +DWORD +WINAPI +GetWindowRegionData( + HWND hwnd, + DWORD size, + LPRGNDATA prd) +{ + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +void +WINAPI +WinWatchClose(HWINWATCH hWW) +{ + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); +} + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +BOOL +WINAPI +WinWatchDidStatusChange(HWINWATCH hWW) +{ + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +UINT +WINAPI +WinWatchGetClipList( + HWINWATCH hWW, + LPRECT prc, + UINT size, + LPRGNDATA prd) +{ + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +BOOL +WINAPI +WinWatchNotify( + HWINWATCH hWW, + WINWATCHNOTIFYPROC NotifyCallback, + LPARAM NotifyParam ) +{ + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + +/* + * @unimplemented + */ +DCMAIN32SDKAPI +HWINWATCH +WINAPI +WinWatchOpen(HWND hwnd) +{ + UNIMPLEMENTED + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; +} + + Propchange: branches/win32k-gdi-dx/dll/win32/dciman32/dciman32_main.c ------------------------------------------------------------------------------ svn:eol-style = native Added: branches/win32k-gdi-dx/dll/win32/dciman32/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/win32k-gdi-dx/dll/win32/dciman3…
============================================================================== --- branches/win32k-gdi-dx/dll/win32/dciman32/precomp.h (added) +++ branches/win32k-gdi-dx/dll/win32/dciman32/precomp.h [iso-8859-1] Sun Jun 8 08:15:47 2008 @@ -1,0 +1,33 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS System Libraries + * FILE: lib/gdi32/include/precomp.h + * PURPOSE: User-Mode Win32 GDI Library Header + * PROGRAMMER: Alex Ionescu (alex(a)relsoft.net) + */ + +/* INCLUDES ******************************************************************/ + +/* Definitions */ +#define WIN32_NO_STATUS +#define NTOS_MODE_USER +#define BUILDING_DCIMAN32 + +/* SDK/DDK/NDK Headers. */ +#include <windows.h> +#include <ndk/ntndk.h> +#include <wingdi.h> +#include <winddi.h> +#include <d3dnthal.h> +#include <prntfont.h> +#include <dciddi.h> +#include <dciman.h> + +/* Public Win32K Headers */ +#include <win32k/ntgdityp.h> +#include <ntgdi.h> +#include <win32k/ntgdihdl.h> + +#define UNIMPLEMENTED DbgPrint("DCIMAN32: %s is unimplemented, please try again later.\n", __FUNCTION__); + +/* EOF */ Propchange: branches/win32k-gdi-dx/dll/win32/dciman32/precomp.h ------------------------------------------------------------------------------ svn:eol-style = native
16 years, 6 months
1
0
0
0
[hpoussin] 33899: Fix debug message
by hpoussin@svn.reactos.org
Author: hpoussin Date: Sun Jun 8 04:52:56 2008 New Revision: 33899 URL:
http://svn.reactos.org/svn/reactos?rev=33899&view=rev
Log: Fix debug message Modified: trunk/reactos/dll/win32/gdi32/objects/font.c 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] Sun Jun 8 04:52:56 2008 @@ -109,7 +109,7 @@ lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0); strW = HeapAlloc(GetProcessHeap(), 0, lenW*sizeof(WCHAR)); MultiByteToWideChar(cp, 0, str, count, strW, lenW); - DPRINT1("mapped %s -> %s \n", str, strW); + DPRINT1("mapped %s -> %S\n", str, strW); if(plenW) *plenW = lenW; if(pCP) *pCP = cp; return strW;
16 years, 6 months
1
0
0
0
[dchapyshev] 33898: - Add gdiplus test to bootcd
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Sun Jun 8 04:49:48 2008 New Revision: 33898 URL:
http://svn.reactos.org/svn/reactos?rev=33898&view=rev
Log: - Add gdiplus test to bootcd Modified: trunk/reactos/boot/bootdata/packages/reactos.dff Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Sun Jun 8 04:49:48 2008 @@ -629,6 +629,7 @@ modules\rostests\winetests\comctl32\comctl32_winetest.exe 7 optional modules\rostests\winetests\comdlg32\comdlg32_winetest.exe 7 optional modules\rostests\winetests\gdi32\gdi32_winetest.exe 7 optional +modules\rostests\winetests\gdiplus\gdiplus_winetest.exe 7 optional modules\rostests\winetests\hlink\hlink_winetest.exe 7 optional modules\rostests\winetests\icmp\icmp_winetest.exe 7 optional modules\rostests\winetests\kernel32\kernel32_winetest.exe 7 optional
16 years, 6 months
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
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