winehq.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
2025
February
January
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2007
----- 2025 -----
February 2025
January 2025
----- 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
957 discussions
Start a n
N
ew thread
Evan Stade : gdiplus: Added GdipAddPathArc test.
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: 1f7cfb1dc829bcec72b3af324ef4c125cd82de91 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f7cfb1dc829bcec72b3af324…
Author: Evan Stade <estade(a)gmail.com> Date: Wed Jul 11 18:07:04 2007 -0700 gdiplus: Added GdipAddPathArc test. --- dlls/gdiplus/tests/graphicspath.c | 70 +++++++++++++++++++++++++++++++++++++ 1 files changed, 70 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index e5fe592..a24853d 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -185,6 +185,75 @@ static void test_line2(void) ok_path(path, line2_path, sizeof(line2_path)/sizeof(path_test_t), FALSE); } +static path_test_t arc_path[] = { + {600.0, 450.0, PathPointTypeStart, 0, 0}, /*0*/ + {600.0, 643.3, PathPointTypeBezier, 0, 0}, /*1*/ + {488.1, 800.0, PathPointTypeBezier, 0, 0}, /*2*/ + {350.0, 800.0, PathPointTypeBezier, 0, 0}, /*3*/ + {600.0, 450.0, PathPointTypeLine, 0, 0}, /*4*/ + {600.0, 643.3, PathPointTypeBezier, 0, 0}, /*5*/ + {488.1, 800.0, PathPointTypeBezier, 0, 0}, /*6*/ + {350.0, 800.0, PathPointTypeBezier, 0, 0}, /*7*/ + {329.8, 800.0, PathPointTypeBezier, 0, 0}, /*8*/ + {309.7, 796.6, PathPointTypeBezier, 0, 0}, /*9*/ + {290.1, 789.8, PathPointTypeBezier, 0, 0}, /*10*/ + {409.9, 110.2, PathPointTypeLine, 0, 0}, /*11*/ + {544.0, 156.5, PathPointTypeBezier, 0, 0}, /*12*/ + {625.8, 346.2, PathPointTypeBezier, 0, 0}, /*13*/ + {592.7, 533.9, PathPointTypeBezier, 0, 0}, /*14*/ + {592.5, 535.3, PathPointTypeBezier, 0, 0}, /*15*/ + {592.2, 536.7, PathPointTypeBezier, 0, 0}, /*16*/ + {592.0, 538.1, PathPointTypeBezier, 0, 0}, /*17*/ + {409.9, 789.8, PathPointTypeLine, 0, 0}, /*18*/ + {544.0, 743.5, PathPointTypeBezier, 0, 0}, /*19*/ + {625.8, 553.8, PathPointTypeBezier, 0, 0}, /*20*/ + {592.7, 366.1, PathPointTypeBezier, 0, 0}, /*21*/ + {592.5, 364.7, PathPointTypeBezier, 0, 0}, /*22*/ + {592.2, 363.3, PathPointTypeBezier, 0, 0}, /*23*/ + {592.0, 361.9, PathPointTypeBezier, 0, 0}, /*24*/ + {540.4, 676.9, PathPointTypeLine, 0, 0}, /*25*/ + {629.9, 529.7, PathPointTypeBezier, 0, 0}, /*26*/ + {617.2, 308.8, PathPointTypeBezier, 0, 0}, /*27*/ + {512.1, 183.5, PathPointTypeBezier, 0, 0}, /*28*/ + {406.9, 58.2, PathPointTypeBezier, 0, 0}, /*29*/ + {249.1, 75.9, PathPointTypeBezier, 0, 0}, /*30*/ + {159.6, 223.1, PathPointTypeBezier, 0, 0}, /*31*/ + {70.1, 370.3, PathPointTypeBezier, 0, 0}, /*32*/ + {82.8, 591.2, PathPointTypeBezier, 0, 0}, /*33*/ + {187.9, 716.5, PathPointTypeBezier, 0, 0}, /*34*/ + {293.1, 841.8, PathPointTypeBezier, 0, 0}, /*35*/ + {450.9, 824.1, PathPointTypeBezier, 0, 0}, /*36*/ + {540.4, 676.9, PathPointTypeBezier, 0, 0} /*37*/ + }; + +static void test_arc(void) +{ + GpStatus status; + GpPath* path; + + GdipCreatePath(FillModeAlternate, &path); + /* Exactly 90 degrees */ + status = GdipAddPathArc(path, 100.0, 100.0, 500.0, 700.0, 0.0, 90.0); + expect(Ok, status); + /* Over 90 degrees */ + status = GdipAddPathArc(path, 100.0, 100.0, 500.0, 700.0, 0.0, 100.0); + expect(Ok, status); + /* Negative start angle */ + status = GdipAddPathArc(path, 100.0, 100.0, 500.0, 700.0, -80.0, 100.0); + expect(Ok, status); + /* Negative sweep angle */ + status = GdipAddPathArc(path, 100.0, 100.0, 500.0, 700.0, 80.0, -100.0); + expect(Ok, status); + /* More than a full revolution */ + status = GdipAddPathArc(path, 100.0, 100.0, 500.0, 700.0, 50.0, -400.0); + expect(Ok, status); + /* 0 sweep angle */ + status = GdipAddPathArc(path, 100.0, 100.0, 500.0, 700.0, 50.0, 0.0); + expect(Ok, status); + + ok_path(path, arc_path, sizeof(arc_path)/sizeof(path_test_t), FALSE); +} + START_TEST(graphicspath) { struct GdiplusStartupInput gdiplusStartupInput; @@ -199,6 +268,7 @@ START_TEST(graphicspath) test_constructor_destructor(); test_line2(); + test_arc(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Evan Stade : gdiplus: Added GdipAddPathArc.
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: 69fa7457e5d746b71c8fef1f2ffb1924a5bc8d35 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=69fa7457e5d746b71c8fef1f2…
Author: Evan Stade <estade(a)gmail.com> Date: Wed Jul 11 18:06:56 2007 -0700 gdiplus: Added GdipAddPathArc. --- dlls/gdiplus/gdiplus.c | 107 ++++++++++++++++++++++++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/gdiplus_private.h | 3 + dlls/gdiplus/graphicspath.c | 31 ++++++++++++ include/gdiplusflat.h | 1 + 5 files changed, 143 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 959bcb0..e821b18 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -17,12 +17,14 @@ */ #include <stdarg.h> +#include <math.h> #include "windef.h" #include "winbase.h" #include "winerror.h" #include "wine/debug.h" #include "gdiplus.h" +#include "gdiplus_private.h" WINE_DEFAULT_DEBUG_CHANNEL(gdiplus); @@ -92,6 +94,111 @@ void WINGDIPAPI GdipFree(void* ptr) HeapFree(GetProcessHeap(), 0, ptr); } +/* Calculates the bezier points needed to fill in the arc portion starting at + * angle start and ending at end. These two angles should be no more than 90 + * degrees from each other. x1, y1, x2, y2 describes the bounding box (upper + * left and width and height). Angles must be in radians. write_first indicates + * that the first bezier point should be written out (usually this is false). + * pt is the array of GpPointFs that gets written to. + **/ +static void add_arc_part(GpPointF * pt, REAL x1, REAL y1, REAL x2, REAL y2, + REAL start, REAL end, BOOL write_first) +{ + REAL center_x, center_y, rad_x, rad_y, cos_start, cos_end, + sin_start, sin_end, a, half; + INT i; + + rad_x = x2 / 2.0; + rad_y = y2 / 2.0; + center_x = x1 + rad_x; + center_y = y1 + rad_y; + + cos_start = cos(start); + cos_end = cos(end); + sin_start = sin(start); + sin_end = sin(end); + + half = (end - start) / 2.0; + a = 4.0 / 3.0 * (1 - cos(half)) / sin(half); + + if(write_first){ + pt[0].X = cos_start; + pt[0].Y = sin_start; + } + pt[1].X = cos_start - a * sin_start; + pt[1].Y = sin_start + a * cos_start; + + pt[3].X = cos_end; + pt[3].Y = sin_end; + pt[2].X = cos_end + a * sin_end; + pt[2].Y = sin_end - a * cos_end; + + /* expand the points back from the unit circle to the ellipse */ + for(i = (write_first ? 0 : 1); i < 4; i ++){ + pt[i].X = pt[i].X * rad_x + center_x; + pt[i].Y = pt[i].Y * rad_y + center_y; + } +} + +/* We plot the curve as if it is on a circle then stretch the points. This + * adjusts the angles so that when we stretch the points they will end in the + * right place. This is only complicated because atan and atan2 do not behave + * conveniently. */ +static void unstretch_angle(REAL * angle, REAL rad_x, REAL rad_y) +{ + REAL stretched; + INT revs_off; + + *angle = deg2rad(*angle); + + if(cos(*angle) == 0 || sin(*angle) == 0) + return; + + stretched = atan2(sin(*angle) / rad_y, cos(*angle) / rad_x); + revs_off = roundr(*angle / (2.0 * M_PI)) - roundr(stretched / (2.0 * M_PI)); + stretched += ((REAL)revs_off) * M_PI * 2.0; + *angle = stretched; +} + +/* Stores the bezier points that correspond to the arc in points. If points is + * null, just return the number of points needed to represent the arc. */ +INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2, + REAL startAngle, REAL sweepAngle) +{ + INT i, count; + REAL end_angle, start_angle, endAngle; + + endAngle = startAngle + sweepAngle; + unstretch_angle(&startAngle, x2 / 2.0, y2 / 2.0); + unstretch_angle(&endAngle, x2 / 2.0, y2 / 2.0); + + count = ceilf(fabs(endAngle - startAngle) / M_PI_2) * 3 + 1; + /* don't make more than a full circle */ + count = min(MAX_ARC_PTS, count); + + if(count == 1) + return 0; + if(!points) + return count; + + /* start_angle and end_angle are the iterative variables */ + start_angle = startAngle; + + for(i = 0; i < count - 1; i += 3){ + /* check if we've overshot the end angle */ + if( sweepAngle > 0.0 ) + end_angle = min(start_angle + M_PI_2, endAngle); + else + end_angle = max(start_angle - M_PI_2, endAngle); + + add_arc_part(&points[i], x1, y1, x2, y2, start_angle, end_angle, i == 0); + + start_angle += M_PI_2 * (sweepAngle < 0.0 ? -1.0 : 1.0); + } + + return count; +} + COLORREF ARGB2COLORREF(ARGB color) { /* diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 2d001ff..22b085e 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -1,4 +1,4 @@ -@ stub GdipAddPathArc +@ stdcall GdipAddPathArc(ptr long long long long long long) @ stub GdipAddPathArcI @ stub GdipAddPathBezier @ stub GdipAddPathBezierI diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 5bcedd9..e37c20e 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -24,8 +24,11 @@ #include "gdiplus.h" #define GP_DEFAULT_PENSTYLE (PS_GEOMETRIC | PS_ENDCAP_FLAT | PS_JOIN_MITER) +#define MAX_ARC_PTS (13) COLORREF ARGB2COLORREF(ARGB color); +extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2, + REAL startAngle, REAL sweepAngle); static inline INT roundr(REAL x) { diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 5df628d..e65dabd 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -63,6 +63,37 @@ static BOOL lengthen_path(GpPath *path, INT len) return TRUE; } +GpStatus WINGDIPAPI GdipAddPathArc(GpPath *path, REAL x1, REAL y1, REAL x2, + REAL y2, REAL startAngle, REAL sweepAngle) +{ + INT count, old_count, i; + + if(!path) + return InvalidParameter; + + count = arc2polybezier(NULL, x1, y1, x2, y2, startAngle, sweepAngle); + + if(count == 0) + return Ok; + if(!lengthen_path(path, count)) + return OutOfMemory; + + old_count = path->pathdata.Count; + arc2polybezier(&path->pathdata.Points[old_count], x1, y1, x2, y2, + startAngle, sweepAngle); + + for(i = 0; i < count; i++){ + path->pathdata.Types[old_count + i] = PathPointTypeBezier; + } + + path->pathdata.Types[old_count] = + (path->newfigure ? PathPointTypeStart : PathPointTypeLine); + path->newfigure = FALSE; + path->pathdata.Count += count; + + return Ok; +} + GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points, INT count) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index d9f5f9a..e49ecc3 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -48,6 +48,7 @@ GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*); +GpStatus WINGDIPAPI GdipAddPathArc(GpPath*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipClosePathFigure(GpPath*); GpStatus WINGDIPAPI GdipClosePathFigures(GpPath*);
1
0
0
0
Evan Stade : gdiplus: Moved two inline helpers to the header.
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: 4a8a1b423c4d8984e61eae9efff7cbdf846b79f1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a8a1b423c4d8984e61eae9ef…
Author: Evan Stade <estade(a)gmail.com> Date: Wed Jul 11 18:06:44 2007 -0700 gdiplus: Moved two inline helpers to the header. --- dlls/gdiplus/gdiplus_private.h | 11 +++++++++++ dlls/gdiplus/graphics.c | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index d036057..5bcedd9 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -19,6 +19,7 @@ #ifndef __WINE_GP_PRIVATE_H_ #define __WINE_GP_PRIVATE_H_ +#include <math.h> #include "windef.h" #include "gdiplus.h" @@ -26,6 +27,16 @@ COLORREF ARGB2COLORREF(ARGB color); +static inline INT roundr(REAL x) +{ + return (INT) floorf(x + 0.5); +} + +static inline REAL deg2rad(REAL degrees) +{ + return M_PI * degrees / 180.0; +} + struct GpPen{ UINT style; COLORREF color; diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index af1089a..c32a412 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -34,16 +34,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus); #define ANCHOR_WIDTH (2.0) #define MAX_ITERS (50) -static inline INT roundr(REAL x) -{ - return (INT) floor(x+0.5); -} - -static inline REAL deg2rad(REAL degrees) -{ - return (M_PI*2.0) * degrees / 360.0; -} - /* Converts angle (in degrees) to x/y coordinates */ static void deg2xy(REAL angle, REAL x_0, REAL y_0, REAL *x, REAL *y) {
1
0
0
0
Mark Adams : iphlpapi: Fix byte ordering of Linux ports.
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: 9c4a1289406c46e239c4542f5cdfabd2622a97c4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9c4a1289406c46e239c4542f5…
Author: Mark Adams <mark(a)transgaming.com> Date: Wed Jul 11 00:16:37 2007 -0400 iphlpapi: Fix byte ordering of Linux ports. --- dlls/iphlpapi/iphlpapi_main.c | 10 ++++++---- dlls/iphlpapi/ipstats.c | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 799f7fc..2aac18d 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -296,13 +296,15 @@ static int TcpTableSorter(const void *a, const void *b) const MIB_TCPROW* rowA = a; const MIB_TCPROW* rowB = b; - ret = rowA->dwLocalAddr - rowB->dwLocalAddr; + ret = ntohl (rowA->dwLocalAddr) - ntohl (rowB->dwLocalAddr); if (ret == 0) { - ret = rowA->dwLocalPort - rowB->dwLocalPort; + ret = ntohs ((unsigned short)rowA->dwLocalPort) - + ntohs ((unsigned short)rowB->dwLocalPort); if (ret == 0) { - ret = rowA->dwRemoteAddr - rowB->dwRemoteAddr; + ret = ntohl (rowA->dwRemoteAddr) - ntohl (rowB->dwRemoteAddr); if (ret == 0) - ret = rowA->dwRemotePort - rowB->dwRemotePort; + ret = ntohs ((unsigned short)rowA->dwRemotePort) - + ntohs ((unsigned short)rowB->dwRemotePort); } } } diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index 7c6488c..69dd978 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -1316,7 +1316,7 @@ DWORD getTcpTable(PMIB_TCPTABLE *ppTcpTable, DWORD maxEntries, HANDLE heap, if (ptr && *ptr) { ptr++; table->table[table->dwNumEntries].dwLocalPort = - strtoul(ptr, &endPtr, 16); + htons ((unsigned short)strtoul(ptr, &endPtr, 16)); ptr = endPtr; } if (ptr && *ptr) { @@ -1327,7 +1327,7 @@ DWORD getTcpTable(PMIB_TCPTABLE *ppTcpTable, DWORD maxEntries, HANDLE heap, if (ptr && *ptr) { ptr++; table->table[table->dwNumEntries].dwRemotePort = - strtoul(ptr, &endPtr, 16); + htons ((unsigned short)strtoul(ptr, &endPtr, 16)); ptr = endPtr; } if (ptr && *ptr) {
1
0
0
0
Mark Adams : iphlpapi: Add support for GetTcpTable on Mac OS X.
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: 2569635cbfdd5c16b8c4ec67cb34c9047c07768c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2569635cbfdd5c16b8c4ec67c…
Author: Mark Adams <mark(a)transgaming.com> Date: Tue Jul 10 23:39:21 2007 -0400 iphlpapi: Add support for GetTcpTable on Mac OS X. --- configure | 80 ++++++++- configure.ac | 21 ++- dlls/iphlpapi/iphlpapi_main.c | 25 +-- dlls/iphlpapi/ipstats.c | 422 +++++++++++++++++++++++++++++----------- dlls/iphlpapi/ipstats.h | 3 +- include/config.h.in | 12 ++ 6 files changed, 428 insertions(+), 135 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=2569635cbfdd5c16b8c4e…
1
0
0
0
Huw Davies : kernel32: SetNamedPipeHandleState() is a stub, so for now don' t check its return value.
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: 154389ce8e98f2f1639c3d03490174ec170a2d34 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=154389ce8e98f2f1639c3d034…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Jul 11 12:39:03 2007 +0100 kernel32: SetNamedPipeHandleState() is a stub, so for now don't check its return value. --- dlls/kernel32/sync.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c index dd673dd..7b67948 100644 --- a/dlls/kernel32/sync.c +++ b/dlls/kernel32/sync.c @@ -1538,11 +1538,15 @@ BOOL WINAPI CallNamedPipeW( mode = PIPE_READMODE_MESSAGE; ret = SetNamedPipeHandleState(pipe, &mode, NULL, NULL); + + /* Currently SetNamedPipeHandleState() is a stub returning FALSE */ + if (ret) FIXME("Now that SetNamedPipeHandleState() is more than a stub, please update CallNamedPipeW\n"); + /* if (!ret) { CloseHandle(pipe); return FALSE; - } + }*/ ret = TransactNamedPipe(pipe, lpInput, lpInputSize, lpOutput, lpOutputSize, lpBytesRead, NULL); CloseHandle(pipe);
1
0
0
0
Huw Davies : kernel32: Swap incorrect use of buffers.
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: f2894533d561bb1c42872e54eef9599251e450d7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f2894533d561bb1c42872e54e…
Author: Huw Davies <huw(a)codeweavers.com> Date: Wed Jul 11 12:34:48 2007 +0100 kernel32: Swap incorrect use of buffers. --- dlls/kernel32/sync.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c index 07bd9b0..dd673dd 100644 --- a/dlls/kernel32/sync.c +++ b/dlls/kernel32/sync.c @@ -1376,25 +1376,25 @@ BOOL WINAPI DisconnectNamedPipe(HANDLE hPipe) * should be done as a single operation in the wineserver or kernel */ BOOL WINAPI TransactNamedPipe( - HANDLE handle, LPVOID lpInput, DWORD dwInputSize, LPVOID lpOutput, - DWORD dwOutputSize, LPDWORD lpBytesRead, LPOVERLAPPED lpOverlapped) + HANDLE handle, LPVOID write_buf, DWORD write_size, LPVOID read_buf, + DWORD read_size, LPDWORD bytes_read, LPOVERLAPPED overlapped) { BOOL r; DWORD count; TRACE("%p %p %d %p %d %p %p\n", - handle, lpInput, dwInputSize, lpOutput, - dwOutputSize, lpBytesRead, lpOverlapped); + handle, write_buf, write_size, read_buf, + read_size, bytes_read, overlapped); - if (lpOverlapped) + if (overlapped) { FIXME("Doesn't support overlapped operation as yet\n"); return FALSE; } - r = WriteFile(handle, lpOutput, dwOutputSize, &count, NULL); + r = WriteFile(handle, write_buf, write_size, &count, NULL); if (r) - r = ReadFile(handle, lpInput, dwInputSize, lpBytesRead, NULL); + r = ReadFile(handle, read_buf, read_size, bytes_read, NULL); return r; }
1
0
0
0
Alexandre Julliard : msi/tests: Comment out call to function that is still a stub in Wine.
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: 3f9632ca5387c5e82f0283ea8c4530056a59a147 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f9632ca5387c5e82f0283ea8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 12 13:00:47 2007 +0200 msi/tests: Comment out call to function that is still a stub in Wine. --- dlls/msi/tests/install.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 5f448da..61b5855 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -2342,8 +2342,10 @@ static void generate_transform(void) r = MsiDatabaseGenerateTransform(hdb1, hdb2, mstfile, 0, 0); ok(r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r); +#if 0 /* not implemented in wine yet */ r = MsiCreateTransformSummaryInfo(hdb2, hdb2, mstfile, 0, 0); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); +#endif MsiCloseHandle(hdb1); MsiCloseHandle(hdb2);
1
0
0
0
Paul Vriens : programs/cmd: Do the assignment after the return to avoid a missing free() (Coverity).
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: 61d8402fe26e229ee1cd6f6d2b469e2f2b60f513 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=61d8402fe26e229ee1cd6f6d2…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Thu Jul 12 09:35:00 2007 +0200 programs/cmd: Do the assignment after the return to avoid a missing free() (Coverity). --- programs/cmd/wcmdmain.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 247ee81..6d1e7d1 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1647,11 +1647,11 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start) { *(colonpos+1) = savedchar; } - s = WCMD_strdupW(endOfVar + 1); - /* Command line - just ignore this */ if (context == NULL) return endOfVar+1; + s = WCMD_strdupW(endOfVar + 1); + /* Batch - replace unknown env var with nothing */ if (colonpos == NULL) { strcpyW (start, s);
1
0
0
0
Misha Koshelev : urlmon: Make HttpProtocol conform with native wininet on wine.
by Alexandre Julliard
12 Jul '07
12 Jul '07
Module: wine Branch: master Commit: 11ccc0f79e0468356be275f72f344d3737cec5bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=11ccc0f79e0468356be275f72…
Author: Misha Koshelev <mk144210(a)bcm.edu> Date: Thu Jul 12 00:46:04 2007 -0500 urlmon: Make HttpProtocol conform with native wininet on wine. --- dlls/urlmon/http.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 47 insertions(+), 6 deletions(-) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index ff79334..926fc91 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -62,12 +62,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(urlmon); * if OnResponse does not return S_OK, Continue will not report data, and Read * will report BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION when all * data has been read. + * + * FLAG_CALLED_SWITCH is set before calling the protocol sink Switch function and + * unset by our Continue function to ensure that Switch is not called again until + * Continue is executed by the protocol sink. */ #define FLAG_REQUEST_COMPLETE 0x1 #define FLAG_FIRST_DATA_REPORTED 0x2 #define FLAG_ALL_DATA_READ 0x4 #define FLAG_LAST_DATA_REPORTED 0x8 #define FLAG_RESULT_REPORTED 0x10 +#define FLAG_CALLED_SWITCH 0x20 typedef struct { const IInternetProtocolVtbl *lpInternetProtocolVtbl; @@ -173,11 +178,22 @@ static void CALLBACK HTTPPROTOCOL_InternetStatusCallback( ulStatusCode = BINDSTATUS_SENDINGREQUEST; break; case INTERNET_STATUS_REQUEST_COMPLETE: - This->flags |= FLAG_REQUEST_COMPLETE; + if (This->flags & FLAG_CALLED_SWITCH) + return; + This->flags |= FLAG_CALLED_SWITCH; + /* PROTOCOLDATA same as native */ memset(&data, 0, sizeof(data)); data.dwState = 0xf1000000; - data.pData = (LPVOID)BINDSTATUS_DOWNLOADINGDATA; + if (!(This->flags & FLAG_REQUEST_COMPLETE)) + { + This->flags |= FLAG_REQUEST_COMPLETE; + data.pData = (LPVOID)BINDSTATUS_DOWNLOADINGDATA; + } + else + { + data.pData = (LPVOID)BINDSTATUS_ENDDOWNLOADCOMPONENTS; + } IInternetProtocolSink_Switch(This->protocol_sink, &data); return; default: @@ -483,14 +499,29 @@ static HRESULT WINAPI HttpProtocol_Continue(IInternetProtocol *iface, PROTOCOLDA TRACE("(%p)->(%p)\n", This, pProtocolData); if (!pProtocolData) + { WARN("Expected pProtocolData to be non-NULL\n"); + goto done; + } else if (!This->request) + { WARN("Expected request to be non-NULL\n"); + goto done; + } else if (!This->http_negotiate) + { WARN("Expected IHttpNegotiate pointer to be non-NULL\n"); + goto done; + } else if (!This->protocol_sink) + { WARN("Expected IInternetProtocolSink pointer to be non-NULL\n"); - else if (pProtocolData->pData == (LPVOID)BINDSTATUS_DOWNLOADINGDATA) + goto done; + } + + This->flags &= ~FLAG_CALLED_SWITCH; + + if (pProtocolData->pData == (LPVOID)BINDSTATUS_DOWNLOADINGDATA) { if (!HttpQueryInfoW(This->request, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status_code, &len, NULL)) @@ -552,7 +583,10 @@ static HRESULT WINAPI HttpProtocol_Continue(IInternetProtocol *iface, PROTOCOLDA { This->content_length = atoiW(content_length); } + } + if (pProtocolData->pData >= (LPVOID)BINDSTATUS_DOWNLOADINGDATA) + { if (!InternetQueryDataAvailable(This->request, &This->available_bytes, 0, 0)) { WARN("InternetQueryDataAvailable failed: %d\n", GetLastError()); @@ -622,9 +656,16 @@ static HRESULT WINAPI HttpProtocol_Read(IInternetProtocol *iface, void *pv, { if (!InternetQueryDataAvailable(This->request, &This->available_bytes, 0, 0)) { - WARN("InternetQueryDataAvailable failed: %d\n", GetLastError()); - hres = INET_E_DATA_NOT_AVAILABLE; - HTTPPROTOCOL_ReportResult(This, hres); + if (GetLastError() == ERROR_IO_PENDING) + { + hres = E_PENDING; + } + else + { + WARN("InternetQueryDataAvailable failed: %d\n", GetLastError()); + hres = INET_E_DATA_NOT_AVAILABLE; + HTTPPROTOCOL_ReportResult(This, hres); + } goto done; } else if (This->available_bytes == 0)
1
0
0
0
← Newer
1
...
64
65
66
67
68
69
70
...
96
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Results per page:
10
25
50
100
200