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
August 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
1085 discussions
Start a n
N
ew thread
Francois Gouget : gdiplus: Add some extra prototypes.
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: 4067c194c6fbbe3139c584d2bb1ff931e22150d7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4067c194c6fbbe3139c584d2b…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Aug 30 16:14:29 2007 +0200 gdiplus: Add some extra prototypes. --- include/gdiplusflat.h | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 29d9f5b..05ed742 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -143,8 +143,13 @@ GpStatus WINGDIPAPI GdipCreatePathGradientI(GDIPCONST GpPoint*,INT,GpWrapMode,Gp GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath*, GpPathGradient**); GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**); +GpStatus WINGDIPAPI GdipCreateTexture(GpImage*,GpWrapMode,GpTexture**); +GpStatus WINGDIPAPI GdipCreateTexture2(GpImage*,GpWrapMode,REAL,REAL,REAL,REAL,GpTexture**); +GpStatus WINGDIPAPI GdipCreateTexture2I(GpImage*,GpWrapMode,INT,INT,INT,INT,GpTexture**); GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage*,GDIPCONST GpImageAttributes*, REAL,REAL,REAL,REAL,GpTexture**); +GpStatus WINGDIPAPI GdipCreateTextureIAI(GpImage*,GDIPCONST GpImageAttributes*, + INT,INT,INT,INT,GpTexture**); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipGetLineGammaCorrection(GpLineGradient*,BOOL*); @@ -157,6 +162,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient*, ARGB*,INT*); GpStatus WINGDIPAPI GdipGetPathGradientWrapMode(GpPathGradient*,GpWrapMode*); GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill*,ARGB*); +GpStatus WINGDIPAPI GdipGetTextureTransform(GpTexture*,GpMatrix*); GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient*,GDIPCONST REAL*, GDIPCONST REAL*,INT); GpStatus WINGDIPAPI GdipSetLineGammaCorrection(GpLineGradient*,BOOL); @@ -236,8 +242,10 @@ GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap*,INT,INT,ARGB*); GpStatus WINGDIPAPI GdipBitmapSetPixel(GpBitmap*,INT,INT,ARGB); GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap*,GDIPCONST GpRect*,UINT, PixelFormat,BitmapData*); -GpStatus WINGDIPAPI GdipConvertToEmfPlus(const GpGraphics*,GpMetafile*,BOOL*, +GpStatus WINGDIPAPI GdipConvertToEmfPlus(const GpGraphics*,GpMetafile*,INT*, EmfType,const WCHAR*,GpMetafile**); +GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile(const GpGraphics*,GpMetafile*,INT*,const WCHAR*,EmfType,const WCHAR*,GpMetafile**); +GpStatus WINGDIPAPI GdipConvertToEmfPlusToStream(const GpGraphics*,GpMetafile*,INT*,IStream*,EmfType,const WCHAR*,GpMetafile**); GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT,INT,GpGraphics*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*,
1
0
0
0
Francois Gouget : gdiplus: Update win32. api to fix the winapi_check warnings.
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: 20a7ab48d1c663b5a1b8415bc951d1d86c6aea07 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=20a7ab48d1c663b5a1b8415bc…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Aug 30 16:14:18 2007 +0200 gdiplus: Update win32.api to fix the winapi_check warnings. --- tools/winapi/win32.api | 139 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 139 insertions(+), 0 deletions(-) diff --git a/tools/winapi/win32.api b/tools/winapi/win32.api index c26f348..71c8ca6 100644 --- a/tools/winapi/win32.api +++ b/tools/winapi/win32.api @@ -1481,6 +1481,145 @@ void LPCWSTR LPWSTR +%%gdiplus.dll + +%long + +ARGB +BOOL +ColorAdjustType +ColorMatrixFlags +CompositingMode +CompositingQuality +EmfType +GpDashCap +GpDashStyle +GpFillMode +GpLineCap +GpLineJoin +GpMatrixOrder +GpStatus +GpUnit +GpWrapMode +GraphicsState +HDC +HENHMETAFILE +HMETAFILE +HWND +INT +InterpolationMode +LANGID +LinearGradientMode +PixelFormat +PixelOffsetMode +PROPID +SIZE_T +SmoothingMode +Status +StringAlignment +StringTrimming +TextRenderingHint +UINT +WrapMode + +%long --pointer + +ULONG_PTR + +%float + +REAL + +%ptr + +ARGB * +BitmapData * +BOOL * +BYTE * +CLSID * +ColorMatrix * +ColorPalette * +CompositingMode * +CompositingQuality * +DrawImageAbort +EncoderParameters * +GpBitmap * +GpBitmap ** +GpBrush * +GpBrush ** +GpBrushType * +GpCustomLineCap * +GpCustomLineCap ** +GpDashStyle * +GpFillMode * +GpFont * +GpFont ** +GpGraphics * +GpGraphics ** +GpImage * +GpImage ** +GpImageAttributes * +GpImageAttributes ** +GpLineGradient * +GpLineGradient ** +GpMatrix * +GpMatrix ** +GpMetafile * +GpMetafile ** +GpPath * +GpPath ** +GpPathGradient * +GpPathGradient ** +GpPathIterator * +GpPathIterator ** +GpPen * +GpPen ** +GpPoint * +GpPointF * +GpRect * +GpRectF * +GpSolidFill * +GpSolidFill ** +GpStringFormat * +GpStringFormat ** +GpTexture * +GpTexture ** +GpUnit * +GraphicsState * +GUID * +ImageItemData * +ImageType * +INT * +InterpolationMode * +IStream * +IStream ** +LOGFONTA * +LOGFONTW * +MetafileHeader * +PixelFormat * +PixelOffsetMode * +REAL * +RectF * +SmoothingMode * +StringAlignment * +StringTrimming * +TextRenderingHint * +UINT * +ULONG_PTR * +VOID * +WmfPlaceableFileHeader * +struct GdiplusStartupInput * +struct GdiplusStartupOutput * +void * + +%wstr + +WCHAR * + +%void + +void + %%glu32.dll %double
1
0
0
0
Aric Stewart : gdi32: Allocate our glyph metrics in a 128 index chunk sparse array.
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: 80cc1af347b27fc4d28e6d40be3631146959627e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=80cc1af347b27fc4d28e6d40b…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Thu Aug 30 19:17:23 2007 +0900 gdi32: Allocate our glyph metrics in a 128 index chunk sparse array. --- dlls/gdi32/freetype.c | 69 +++++++++++++++++++++++++++---------------------- 1 files changed, 38 insertions(+), 31 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 27955b3..9881f00 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -298,7 +298,7 @@ struct tagGdiFont { BYTE underline; BYTE strikeout; INT orientation; - GM *gm; + GM **gm; DWORD gmsize; struct list hfontlist; FONT_DESC font_desc; @@ -320,7 +320,8 @@ typedef struct { struct list links; } SYSTEM_LINKS; -#define INIT_GM_SIZE 128 +#define GM_BLOCK_SIZE 128 +#define FONT_GM(font,idx) (&(font)->gm[(idx) / GM_BLOCK_SIZE][(idx) % GM_BLOCK_SIZE]) static struct list gdi_font_list = LIST_INIT(gdi_font_list); static struct list unused_gdi_font_list = LIST_INIT(unused_gdi_font_list); @@ -2329,9 +2330,9 @@ static int get_nearest_charset(Face *face, int *cp) static GdiFont *alloc_font(void) { GdiFont *ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ret)); - ret->gmsize = INIT_GM_SIZE; - ret->gm = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - ret->gmsize * sizeof(*ret->gm)); + ret->gmsize = 1; + ret->gm = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GM*)); + ret->gm[0] = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GM) * GM_BLOCK_SIZE); ret->potm = NULL; ret->font_desc.matrix.eM11 = ret->font_desc.matrix.eM22 = 1.0; ret->total_kern_pairs = (DWORD)-1; @@ -2344,6 +2345,7 @@ static GdiFont *alloc_font(void) static void free_font(GdiFont *font) { struct list *cursor, *cursor2; + int i; LIST_FOR_EACH_SAFE(cursor, cursor2, &font->child_fonts) { @@ -2368,6 +2370,8 @@ static void free_font(GdiFont *font) HeapFree(GetProcessHeap(), 0, font->kern_pairs); HeapFree(GetProcessHeap(), 0, font->potm); HeapFree(GetProcessHeap(), 0, font->name); + for (i = 0; i < font->gmsize; i++) + HeapFree(GetProcessHeap(),0,font->gm[i]); HeapFree(GetProcessHeap(), 0, font->gm); HeapFree(GetProcessHeap(), 0, font); } @@ -3381,17 +3385,20 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, ft_face = font->ft_face; } - if(glyph_index >= font->gmsize) { - font->gmsize = (glyph_index / INIT_GM_SIZE + 1) * INIT_GM_SIZE; + if(glyph_index >= font->gmsize * GM_BLOCK_SIZE) { + font->gmsize = (glyph_index / GM_BLOCK_SIZE + 1); font->gm = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, font->gm, - font->gmsize * sizeof(*font->gm)); + font->gmsize * sizeof(GM*)); } else { - if(format == GGO_METRICS && font->gm[glyph_index].init) { - memcpy(lpgm, &font->gm[glyph_index].gm, sizeof(*lpgm)); + if(format == GGO_METRICS && font->gm[glyph_index / GM_BLOCK_SIZE] != NULL && FONT_GM(font,glyph_index)->init ) { + *lpgm = FONT_GM(font,glyph_index)->gm; return 1; /* FIXME */ } } + if (!font->gm[glyph_index / GM_BLOCK_SIZE]) + font->gm[glyph_index / GM_BLOCK_SIZE] = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY, sizeof(GM) * GM_BLOCK_SIZE); + if(font->orientation || (format != GGO_METRICS && format != GGO_BITMAP) || font->aveWidth || lpmat) load_flags |= FT_LOAD_NO_BITMAP; @@ -3410,9 +3417,9 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, left = (INT)(ft_face->glyph->metrics.horiBearingX * widthRatio) & -64; right = (INT)((ft_face->glyph->metrics.horiBearingX + ft_face->glyph->metrics.width) * widthRatio + 63) & -64; - font->gm[glyph_index].adv = (INT)((ft_face->glyph->metrics.horiAdvance * widthRatio) + 63) >> 6; - font->gm[glyph_index].lsb = left >> 6; - font->gm[glyph_index].bbx = (right - left) >> 6; + FONT_GM(font,glyph_index)->adv = (INT)((ft_face->glyph->metrics.horiAdvance * widthRatio) + 63) >> 6; + FONT_GM(font,glyph_index)->lsb = left >> 6; + FONT_GM(font,glyph_index)->bbx = (right - left) >> 6; /* Scaling transform */ if(font->aveWidth) { @@ -3468,7 +3475,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, top = (ft_face->glyph->metrics.horiBearingY + 63) & -64; bottom = (ft_face->glyph->metrics.horiBearingY - ft_face->glyph->metrics.height) & -64; - lpgm->gmCellIncX = font->gm[glyph_index].adv; + lpgm->gmCellIncX = FONT_GM(font,glyph_index)->adv; lpgm->gmCellIncY = 0; } else { INT xc, yc; @@ -3509,8 +3516,8 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, lpgm->gmptGlyphOrigin.x = left >> 6; lpgm->gmptGlyphOrigin.y = top >> 6; - memcpy(&font->gm[glyph_index].gm, lpgm, sizeof(*lpgm)); - font->gm[glyph_index].init = TRUE; + FONT_GM(font,glyph_index)->gm = *lpgm; + FONT_GM(font,glyph_index)->init = TRUE; if(format == GGO_METRICS) return 1; /* FIXME */ @@ -4222,7 +4229,7 @@ BOOL WineEngGetCharWidth(GdiFont *font, UINT firstChar, UINT lastChar, get_glyph_index_linked(font, c, &linked_font, &glyph_index); WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, NULL); - buffer[c - firstChar] = linked_font->gm[glyph_index].adv; + buffer[c - firstChar] = FONT_GM(linked_font,glyph_index)->adv; } return TRUE; } @@ -4248,10 +4255,10 @@ BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar, UINT lastChar, get_glyph_index_linked(font, c, &linked_font, &glyph_index); WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, NULL); - buffer[c - firstChar].abcA = linked_font->gm[glyph_index].lsb; - buffer[c - firstChar].abcB = linked_font->gm[glyph_index].bbx; - buffer[c - firstChar].abcC = linked_font->gm[glyph_index].adv - linked_font->gm[glyph_index].lsb - - linked_font->gm[glyph_index].bbx; + buffer[c - firstChar].abcA = FONT_GM(linked_font,glyph_index)->lsb; + buffer[c - firstChar].abcB = FONT_GM(linked_font,glyph_index)->bbx; + buffer[c - firstChar].abcC = FONT_GM(linked_font,glyph_index)->adv - FONT_GM(linked_font,glyph_index)->lsb - + FONT_GM(linked_font,glyph_index)->bbx; } return TRUE; } @@ -4276,19 +4283,19 @@ BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD for(c = firstChar; c < firstChar+count; c++) { WineEngGetGlyphOutline(linked_font, c, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, NULL); - buffer[c - firstChar].abcA = linked_font->gm[c].lsb; - buffer[c - firstChar].abcB = linked_font->gm[c].bbx; - buffer[c - firstChar].abcC = linked_font->gm[c].adv - linked_font->gm[c].lsb - - linked_font->gm[c].bbx; + buffer[c - firstChar].abcA = FONT_GM(linked_font,c)->lsb; + buffer[c - firstChar].abcB = FONT_GM(linked_font,c)->bbx; + buffer[c - firstChar].abcC = FONT_GM(linked_font,c)->adv - FONT_GM(linked_font,c)->lsb + - FONT_GM(linked_font,c)->bbx; } else for(c = 0; c < count; c++) { WineEngGetGlyphOutline(linked_font, pgi[c], GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, NULL); - buffer[c].abcA = linked_font->gm[pgi[c]].lsb; - buffer[c].abcB = linked_font->gm[pgi[c]].bbx; - buffer[c].abcC = linked_font->gm[pgi[c]].adv - - linked_font->gm[pgi[c]].lsb - linked_font->gm[pgi[c]].bbx; + buffer[c].abcA = FONT_GM(linked_font,pgi[c])->lsb; + buffer[c].abcB = FONT_GM(linked_font,pgi[c])->bbx; + buffer[c].abcC = FONT_GM(linked_font,pgi[c])->adv + - FONT_GM(linked_font,pgi[c])->lsb - FONT_GM(linked_font,pgi[c])->bbx; } return TRUE; @@ -4319,7 +4326,7 @@ BOOL WineEngGetTextExtentExPoint(GdiFont *font, LPCWSTR wstr, INT count, get_glyph_index_linked(font, wstr[idx], &linked_font, &glyph_index); WineEngGetGlyphOutline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, NULL); - size->cx += linked_font->gm[glyph_index].adv; + size->cx += FONT_GM(linked_font,glyph_index)->adv; ext = size->cx; if (! pnfit || ext <= max_ext) { ++nfit; @@ -4356,7 +4363,7 @@ BOOL WineEngGetTextExtentPointI(GdiFont *font, const WORD *indices, INT count, WineEngGetGlyphOutline(font, indices[idx], GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, NULL); - size->cx += font->gm[indices[idx]].adv; + size->cx += FONT_GM(font,indices[idx])->adv; } TRACE("return %d,%d\n", size->cx, size->cy); return TRUE;
1
0
0
0
Lionel Debroux : kernel32: Fix memory leak in CopyFileW.
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: 79326157f9ab0caf85cf70a4a9d7ac8c83cbcced URL:
http://source.winehq.org/git/wine.git/?a=commit;h=79326157f9ab0caf85cf70a4a…
Author: Lionel Debroux <lionel_debroux(a)yahoo.fr> Date: Thu Aug 30 10:28:20 2007 +0200 kernel32: Fix memory leak in CopyFileW. --- dlls/kernel32/path.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index eb752f0..7932df0 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -879,12 +879,14 @@ BOOL WINAPI CopyFileW( LPCWSTR source, LPCWSTR dest, BOOL fail_if_exists ) NULL, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) { WARN("Unable to open source %s\n", debugstr_w(source)); + HeapFree( GetProcessHeap(), 0, buffer ); return FALSE; } if (!GetFileInformationByHandle( h1, &info )) { WARN("GetFileInformationByHandle returned error for %s\n", debugstr_w(source)); + HeapFree( GetProcessHeap(), 0, buffer ); CloseHandle( h1 ); return FALSE; } @@ -894,6 +896,7 @@ BOOL WINAPI CopyFileW( LPCWSTR source, LPCWSTR dest, BOOL fail_if_exists ) info.dwFileAttributes, h1 )) == INVALID_HANDLE_VALUE) { WARN("Unable to open dest %s\n", debugstr_w(dest)); + HeapFree( GetProcessHeap(), 0, buffer ); CloseHandle( h1 ); return FALSE; }
1
0
0
0
Kirill K. Smirnov : winhelp: Add WS_EX_TOOLWINDOW style to popup windows.
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: 43860b7a6ef125a0cf27d30ac8121332824dfa39 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=43860b7a6ef125a0cf27d30ac…
Author: Kirill K. Smirnov <lich(a)math.spbu.ru> Date: Wed Aug 29 19:39:09 2007 +0400 winhelp: Add WS_EX_TOOLWINDOW style to popup windows. --- programs/winhelp/winhelp.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/programs/winhelp/winhelp.c b/programs/winhelp/winhelp.c index 59810bc..44e640e 100644 --- a/programs/winhelp/winhelp.c +++ b/programs/winhelp/winhelp.c @@ -551,6 +551,7 @@ BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, HLPFILE_WINDOWINFO* wi, BOOL bPrimary; BOOL bPopup; LPSTR name; + DWORD ex_style; bPrimary = !lstrcmpi(wi->name, "main"); bPopup = wi->win_style & WS_POPUP; @@ -623,7 +624,9 @@ BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE* page, HLPFILE_WINDOWINFO* wi, } } - hWnd = CreateWindow(bPopup ? TEXT_WIN_CLASS_NAME : MAIN_WIN_CLASS_NAME, + ex_style = 0; + if (bPopup) ex_style = WS_EX_TOOLWINDOW; + hWnd = CreateWindowEx(ex_style, bPopup ? TEXT_WIN_CLASS_NAME : MAIN_WIN_CLASS_NAME, wi->caption, bPrimary ? WS_OVERLAPPEDWINDOW : wi->win_style, wi->origin.x, wi->origin.y, wi->size.cx, wi->size.cy, @@ -983,7 +986,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam, new_window_size.cy = old_window_size.cy - old_client_size.cy + new_client_size.cy; win->hShadowWnd = - CreateWindow(SHADOW_WIN_CLASS_NAME, "", WS_POPUP, + CreateWindowEx(WS_EX_TOOLWINDOW, SHADOW_WIN_CLASS_NAME, "", WS_POPUP, origin.x + SHADOW_DX, origin.y + SHADOW_DY, new_window_size.cx, new_window_size.cy, 0, 0, Globals.hInstance, 0);
1
0
0
0
Alexandre Julliard : ntdll: Pin down all dlls imported by the main exe.
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: e22ce4627881df000508228c1b3e0edcaa03fc85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e22ce4627881df000508228c1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Aug 30 16:34:27 2007 +0200 ntdll: Pin down all dlls imported by the main exe. --- dlls/ntdll/loader.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 843e4d5..04172f9 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -945,6 +945,7 @@ static NTSTATUS process_attach( WINE_MODREF *wm, LPVOID lpReserved ) /* Tag current MODREF to prevent recursive loop */ wm->ldr.Flags |= LDR_LOAD_IN_PROGRESS; + if (lpReserved) wm->ldr.LoadCount = -1; /* pin it if imported by the main exe */ if (wm->ldr.ActivationContext) RtlActivateActivationContext( 0, wm->ldr.ActivationContext, &cookie ); /* Recursively attach all DLLs this one depends on */ @@ -1006,7 +1007,6 @@ static void attach_implicitly_loaded_dlls( LPVOID reserved ) if (mod->Flags & (LDR_LOAD_IN_PROGRESS | LDR_PROCESS_ATTACHED)) continue; TRACE( "found implicitly loaded %s, attaching to it\n", debugstr_w(mod->BaseDllName.Buffer)); - mod->LoadCount = -1; /* we can't unload it anyway */ process_attach( CONTAINING_RECORD(mod, WINE_MODREF, ldr), reserved ); break; /* restart the search from the start */ } @@ -2295,7 +2295,6 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3, ERR("%s is a dll, not an executable\n", debugstr_w(wm->ldr.FullDllName.Buffer) ); exit(1); } - wm->ldr.LoadCount = -1; /* can't unload main exe */ peb->ProcessParameters->ImagePathName = wm->ldr.FullDllName; version_init( wm->ldr.FullDllName.Buffer );
1
0
0
0
Mikolaj Zalewski : user32: Static controls should have a clipping region set while sending the WM_CTLCOLORSTATIC .
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: 613cfc2870a2f351919b22957788174511409fc6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=613cfc2870a2f351919b22957…
Author: Mikolaj Zalewski <mikolajz(a)google.com> Date: Wed Aug 29 10:36:41 2007 -0700 user32: Static controls should have a clipping region set while sending the WM_CTLCOLORSTATIC. --- dlls/user32/static.c | 38 ++++++++++++ dlls/user32/tests/Makefile.in | 1 + dlls/user32/tests/static.c | 130 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 169 insertions(+), 0 deletions(-) diff --git a/dlls/user32/static.c b/dlls/user32/static.c index 8afaca1..bb6abfb 100644 --- a/dlls/user32/static.c +++ b/dlls/user32/static.c @@ -111,6 +111,33 @@ const struct builtin_class_descr STATIC_builtin_class = 0 /* brush */ }; +static void setup_clipping(HWND hwnd, HDC hdc, HRGN *orig) +{ + RECT rc; + HRGN hrgn; + + /* Native control has always a clipping region set (this may be because + * builtin controls uses CS_PARENTDC) and an application depends on it + */ + hrgn = CreateRectRgn(0, 0, 1, 1); + if (GetClipRgn(hdc, hrgn) != 1) + { + DeleteObject(hrgn); + *orig = NULL; + } else + *orig = hrgn; + + GetClientRect(hwnd, &rc); + DPtoLP(hdc, (POINT *)&rc, 2); + IntersectClipRect(hdc, rc.left, rc.top, rc.right, rc.bottom); +} + +static void restore_clipping(HDC hdc, HRGN hrgn) +{ + SelectClipRgn(hdc, hrgn); + if (hrgn != NULL) + DeleteObject(hrgn); +} /*********************************************************************** * STATIC_SetIcon @@ -315,8 +342,12 @@ static VOID STATIC_TryPaintFcn(HWND hwnd, LONG full_style) if (!IsRectEmpty(&rc) && IsWindowVisible(hwnd) && staticPaintFunc[style]) { HDC hdc; + HRGN hOrigClipping; + hdc = GetDC( hwnd ); + setup_clipping(hwnd, hdc, &hOrigClipping); (staticPaintFunc[style])( hwnd, hdc, full_style ); + restore_clipping(hdc, hOrigClipping); ReleaseDC( hwnd, hdc ); } } @@ -413,7 +444,12 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, PAINTSTRUCT ps; HDC hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps); if (staticPaintFunc[style]) + { + HRGN hOrigClipping; + setup_clipping(hwnd, hdc, &hOrigClipping); (staticPaintFunc[style])( hwnd, hdc, full_style ); + restore_clipping(hdc, hOrigClipping); + } if (!wParam) EndPaint(hwnd, &ps); } break; @@ -721,6 +757,7 @@ static void STATIC_PaintRectfn( HWND hwnd, HDC hdc, DWORD style ) GetClientRect( hwnd, &rc); + /* FIXME: send WM_CTLCOLORSTATIC */ switch (style & SS_TYPEMASK) { case SS_BLACKRECT: @@ -865,6 +902,7 @@ static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style ) { RECT rc; + /* FIXME: sometimes (not always) sends WM_CTLCOLORSTATIC */ GetClientRect( hwnd, &rc ); switch (style & SS_TYPEMASK) { diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in index 505d62d..40fec5b 100644 --- a/dlls/user32/tests/Makefile.in +++ b/dlls/user32/tests/Makefile.in @@ -21,6 +21,7 @@ CTESTS = \ monitor.c \ msg.c \ resource.c \ + static.c \ sysparams.c \ text.c \ win.c \ diff --git a/dlls/user32/tests/static.c b/dlls/user32/tests/static.c new file mode 100644 index 0000000..7810db4 --- /dev/null +++ b/dlls/user32/tests/static.c @@ -0,0 +1,130 @@ +/* Unit test suite for static controls. + * + * Copyright 2007 Google (Mikolaj Zalewski) + * + * 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 + */ + +#include <assert.h> +#include <stdarg.h> +#include <stdio.h> + +#define STRICT +#define WIN32_LEAN_AND_MEAN +#include <windows.h> + +#include "wine/test.h" + +#define TODO_COUNT 1 + +#define CTRL_ID 1995 + +static HWND hMainWnd; + +#define expect_eq(expr, value, type, fmt) { type val = expr; ok(val == (value), #expr " expected " #fmt " got " #fmt "\n", (value), val); } +#define expect_rect(r, _left, _top, _right, _bottom) ok(r.left == _left && r.top == _top && \ + r.bottom == _bottom && r.right == _right, "Invalid rect (%d,%d) (%d,%d) vs (%d,%d) (%d,%d)\n", \ + r.left, r.top, r.right, r.bottom, _left, _top, _right, _bottom); + +int g_nReceivedColorStatic = 0; + +static HWND build_static(DWORD style) +{ + return CreateWindow("static", "Test", WS_VISIBLE|WS_CHILD|style, 5, 5, 100, 100, hMainWnd, (HMENU)CTRL_ID, NULL, 0); +} + +static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch (msg) + { + case WM_CTLCOLORSTATIC: + { + HDC hdc = (HDC)wparam; + HRGN hrgn = CreateRectRgn(0, 0, 1, 1); + ok(GetClipRgn(hdc, hrgn) == 1, "Static controls during a WM_CTLCOLORSTATIC must have a clipping region\n"); + DeleteObject(hrgn); + g_nReceivedColorStatic++; + } + break; + } + + return DefWindowProc(hwnd, msg, wparam, lparam); +} + +void test_updates(int style, int flags) +{ + RECT r1 = {20, 20, 30, 30}; + HWND hStatic = build_static(style); + int exp; + + trace("Testing style 0x%x\n", style); + g_nReceivedColorStatic = 0; + /* during each update parent WndProc will test the WM_CTLCOLORSTATIC message */ + InvalidateRect(hMainWnd, NULL, FALSE); + UpdateWindow(hMainWnd); + InvalidateRect(hMainWnd, &r1, FALSE); + UpdateWindow(hMainWnd); + InvalidateRect(hStatic, &r1, FALSE); + UpdateWindow(hStatic); + InvalidateRect(hStatic, NULL, FALSE); + UpdateWindow(hStatic); + + + if (style != SS_ETCHEDHORZ && style != SS_ETCHEDVERT) + exp = 4; + else + exp = 1; /* SS_ETCHED* seems to send WM_CTLCOLORSTATIC only sometimes */ + + if (flags & TODO_COUNT) + todo_wine { expect_eq(g_nReceivedColorStatic, exp, int, "%d"); } + else + expect_eq(g_nReceivedColorStatic, exp, int, "%d"); + DestroyWindow(hStatic); +} + +START_TEST(static) +{ + static char szClassName[] = "testclass"; + WNDCLASSEX wndclass; + + wndclass.cbSize = sizeof(wndclass); + wndclass.style = CS_HREDRAW | CS_VREDRAW; + wndclass.lpfnWndProc = WndProc; + wndclass.cbClsExtra = 0; + wndclass.cbWndExtra = 0; + wndclass.hInstance = GetModuleHandle(NULL); + wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); + wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); + wndclass.lpszClassName = szClassName; + wndclass.lpszMenuName = NULL; + RegisterClassEx(&wndclass); + + hMainWnd = CreateWindow(szClassName, "Test", WS_OVERLAPPEDWINDOW, 0, 0, 500, 500, NULL, NULL, GetModuleHandle(NULL), NULL); + ShowWindow(hMainWnd, SW_SHOW); + UpdateWindow(hMainWnd); + + test_updates(0, 0); + test_updates(SS_SIMPLE, 0); + test_updates(SS_ICON, 0); + test_updates(SS_BITMAP, 0); + test_updates(SS_BLACKRECT, TODO_COUNT); + test_updates(SS_WHITERECT, TODO_COUNT); + test_updates(SS_ETCHEDHORZ, TODO_COUNT); + test_updates(SS_ETCHEDVERT, TODO_COUNT); + + DestroyWindow(hMainWnd); +}
1
0
0
0
Francois Gouget : Assorted spelling fixes.
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: a116879507fdfe69f1309aa34d55a3cf07a4a447 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a116879507fdfe69f1309aa34…
Author: Francois Gouget <fgouget(a)free.fr> Date: Wed Aug 29 21:43:57 2007 +0200 Assorted spelling fixes. --- dlls/d3d9/tests/visual.c | 2 +- dlls/dsound/primary.c | 4 ++-- dlls/msvcrt/mbcs.c | 2 +- dlls/setupapi/tests/parser.c | 2 +- dlls/wined3d/directx.c | 2 +- dlls/wined3d/surface.c | 2 +- dlls/winspool.drv/info.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index a2744e5..2c15d1c 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -1566,7 +1566,7 @@ static void release_buffer_test(IDirect3DDevice9 *device) }; short indices[] = {3, 4, 5}; - /* Index and vertex buffers should always be createable */ + /* Index and vertex buffers should always be creatable */ hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), 0, D3DFVF_XYZ | D3DFVF_DIFFUSE, D3DPOOL_MANAGED, &vb, NULL); ok(hr == D3D_OK, "CreateVertexBuffer failed with %s\n", DXGetErrorString9(hr)); diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index c3b9d91..4c9e125 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -456,9 +456,9 @@ HRESULT DSOUND_PrimarySetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX wfex, } if (err == S_FALSE) { - /* ALSA specific: S_FALSE tells that recreation was succesful, + /* ALSA specific: S_FALSE tells that recreation was successful, * but size and location may be changed, and buffer has to be restarted - * I put it here, so if frequency doesn't match error will be changed to DSERR_BUFFERLOST + * I put it here, so if frequency doesn't match the error will be changed to DSERR_BUFFERLOST * and the entire re-initialization will occur anyway */ IDsDriverBuffer_Lock(device->hwbuf, (LPVOID *)&device->buffer, &device->buflen, NULL, NULL, 0, 0, DSBLOCK_ENTIREBUFFER); diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 3643fda..cc619e5 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -1062,7 +1062,7 @@ int CDECL _ismbslead(const unsigned char* start, const unsigned char* str) if(!g_mbcp_is_multibyte) return 0; - /* Lead bytes can also be trail bytes so we need to analise the string + /* Lead bytes can also be trail bytes so we need to analyse the string */ while (start <= str) { diff --git a/dlls/setupapi/tests/parser.c b/dlls/setupapi/tests/parser.c index f11abb8..1c3ca49 100644 --- a/dlls/setupapi/tests/parser.c +++ b/dlls/setupapi/tests/parser.c @@ -321,7 +321,7 @@ static const struct { "a=%big%%big%%big%%big%%big%%big%%big%%big%%big%%big%%big%\n" STR_SECTION, "a", { A4097 /*MAX_INF_STRING_LENGTH+1*/ } }, /* Prove expansion of system entries removes extra \'s and string - replacements doesnt */ + replacements doesn't */ { "ab=\"%24%\"\n" STR_SECTION, "ab", { "C:\\" } }, { "ab=\"%mydrive%\"\n" STR_SECTION, "ab", { "C:\\" } }, { "ab=\"%24%\\fred\"\n" STR_SECTION, "ab", { "C:\\fred" } }, diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index e60812a..5bf0ae8 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2498,7 +2498,7 @@ BOOL InitAdapters(void) { return FALSE; } -/* Dynamicly load all GL core functions */ +/* Dynamically load all GL core functions */ GL_FUNCS_GEN; #undef USE_GL_FUNC diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 37144c6..b2d3aa1 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1632,7 +1632,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_ break; case WINED3DFMT_R16F: - /* Simmilar to R32F */ + /* Similar to R32F */ *convert = CONVERT_R16F; *format = GL_RGB; *internal = GL_RGB16F_ARB; diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index ce5323b..44c41a1 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -6447,7 +6447,7 @@ BOOL WINAPI AddPrinterDriverExW( LPWSTR pName, DWORD level, LPBYTE pDriverInfo, ptr = get_servername_from_name(pName); HeapFree(GetProcessHeap(), 0, ptr); if (ptr) { - FIXME("not suported for server: %s\n", debugstr_w(pName)); + FIXME("not supported for server: %s\n", debugstr_w(pName)); SetLastError(ERROR_ACCESS_DENIED); return FALSE; }
1
0
0
0
Francois Gouget : kernel32/tests: If the registry happens to be set up right, check that winedbg does not mess up the crashed process exit code ( unfortunately it does).
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: a86c035d7fba9e75b03dbeda7a406f1c67d9dc4f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a86c035d7fba9e75b03dbeda7…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Aug 29 21:42:55 2007 +0200 kernel32/tests: If the registry happens to be set up right, check that winedbg does not mess up the crashed process exit code (unfortunately it does). --- dlls/kernel32/tests/debugger.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 files changed, 36 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index 02e92d4..c7c2270 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -90,10 +90,9 @@ static DWORD get_logged_pid(const char* logfile) static void doCrash(int argc, char** argv) { char* p; - const char* logfile; - logfile=(argc >= 4 ? argv[3] : NULL); - log_pid(logfile, GetCurrentProcessId()); + if (argc >= 4) + log_pid(argv[3], GetCurrentProcessId()); /* Just crash */ trace("child: crashing...\n"); @@ -188,6 +187,36 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* debugger) assert(DeleteFileA(childlog) != 0); } +static void crash_and_winedbg(HKEY hkey, const char* argv0) +{ + DWORD ret; + char* cmd; + PROCESS_INFORMATION info; + STARTUPINFOA startup; + DWORD exit_code; + + ret=RegSetValueExA(hkey, "auto", 0, REG_SZ, (BYTE*)"1", 2); + ok(ret == ERROR_SUCCESS, "unable to set AeDebug/auto: ret=%d\n", ret); + + cmd=HeapAlloc(GetProcessHeap(), 0, strlen(argv0)+15+1); + sprintf(cmd, "%s debugger crash", argv0); + + memset(&startup, 0, sizeof(startup)); + startup.cb = sizeof(startup); + startup.dwFlags = STARTF_USESHOWWINDOW; + startup.wShowWindow = SW_SHOWNORMAL; + ret=CreateProcessA(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info); + ok(ret, "CreateProcess: err=%d\n", GetLastError()); + HeapFree(GetProcessHeap(), 0, cmd); + CloseHandle(info.hThread); + + trace("waiting for child exit...\n"); + ok(WaitForSingleObject(info.hProcess, 60000) == WAIT_OBJECT_0, "Timed out waiting for the child to crash\n"); + ok(GetExitCodeProcess(info.hProcess, &exit_code), "GetExitCodeProcess failed: err=%d\n", GetLastError()); + todo_wine ok(exit_code == STATUS_ACCESS_VIOLATION, "exit code = %08x\n", exit_code); + CloseHandle(info.hProcess); +} + static void test_ExitCode(void) { static const char* AeDebug="Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug"; @@ -239,6 +268,10 @@ static void test_ExitCode(void) return; } + if (debugger_val && debugger_type == REG_SZ && + strstr((char*)debugger_val, "winedbg --auto")) + crash_and_winedbg(hkey, test_exe); + crash_and_debug(hkey, test_exe, "dbgevent"); crash_and_debug(hkey, test_exe, "dbgnoevent");
1
0
0
0
Francois Gouget : kernel32/tests: Don't call ok() in child processes.
by Alexandre Julliard
30 Aug '07
30 Aug '07
Module: wine Branch: master Commit: 1f0fb354f5508be361b45167aba3b7da570d7ca9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f0fb354f5508be361b45167a…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Aug 29 21:43:45 2007 +0200 kernel32/tests: Don't call ok() in child processes. --- dlls/kernel32/tests/debugger.c | 64 +++++++++++++++++++++++++++------------ 1 files changed, 44 insertions(+), 20 deletions(-) diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index c7c2270..54aae65 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -55,7 +55,7 @@ static void get_events(const char* name, HANDLE *start_event, HANDLE *done_event HeapFree(GetProcessHeap(), 0, event_name); } -static void log_pid(const char* logfile, DWORD pid) +static void save_blackbox(const char* logfile, void* blackbox, int size) { HANDLE hFile; DWORD written; @@ -63,14 +63,14 @@ static void log_pid(const char* logfile, DWORD pid) hFile=CreateFileA(logfile, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); if (hFile == INVALID_HANDLE_VALUE) return; - WriteFile(hFile, &pid, sizeof(pid), &written, NULL); + WriteFile(hFile, blackbox, size, &written, NULL); CloseHandle(hFile); } -static DWORD get_logged_pid(const char* logfile) +static int load_blackbox(const char* logfile, void* blackbox, int size) { HANDLE hFile; - DWORD pid, read; + DWORD read; BOOL ret; hFile=CreateFileA(logfile, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); @@ -79,20 +79,27 @@ static DWORD get_logged_pid(const char* logfile) ok(0, "unable to open '%s'\n", logfile); return 0; } - pid=0; - read=sizeof(pid); - ret=ReadFile(hFile, &pid, sizeof(pid), &read, NULL); - ok(read == sizeof(pid), "wrong size for '%s': read=%d\n", logfile, read); + ret=ReadFile(hFile, blackbox, size, &read, NULL); + ok(read == size, "wrong size for '%s': read=%d\n", logfile, read); CloseHandle(hFile); - return pid; + return 1; } +typedef struct +{ + DWORD pid; +} crash_blackbox_t; + static void doCrash(int argc, char** argv) { char* p; if (argc >= 4) - log_pid(argv[3], GetCurrentProcessId()); + { + crash_blackbox_t blackbox; + blackbox.pid=GetCurrentProcessId(); + save_blackbox(argv[3], &blackbox, sizeof(blackbox)); + } /* Just crash */ trace("child: crashing...\n"); @@ -100,22 +107,33 @@ static void doCrash(int argc, char** argv) *p=0; } +typedef struct +{ + int argc; + DWORD pid; + BOOL debug_rc; + DWORD debug_err; +} debugger_blackbox_t; + static void doDebugger(int argc, char** argv) { const char* logfile; + debugger_blackbox_t blackbox; HANDLE start_event, done_event, debug_event; - DWORD pid; - ok(argc == 6, "wrong debugger argument count: %d\n", argc); + blackbox.argc=argc; logfile=(argc >= 4 ? argv[3] : NULL); - pid=(argc >= 5 ? atol(argv[4]) : 0); + blackbox.pid=(argc >= 5 ? atol(argv[4]) : 0); debug_event=(argc >= 6 ? (HANDLE)atol(argv[5]) : NULL); if (debug_event && strcmp(myARGV[2], "dbgnoevent") != 0) { - ok(SetEvent(debug_event), "debugger: SetEvent(debug_event) failed\n"); + blackbox.debug_rc=SetEvent(debug_event); + if (!blackbox.debug_rc) + blackbox.debug_err=GetLastError(); } + else + blackbox.debug_rc=TRUE; - log_pid(logfile, pid); get_events(logfile, &start_event, &done_event); if (strcmp(myARGV[2], "dbgnoevent") != 0) { @@ -123,8 +141,9 @@ static void doDebugger(int argc, char** argv) WaitForSingleObject(start_event, INFINITE); } - ok(SetEvent(done_event), "debugger: SetEvent(done_event) failed\n"); + save_blackbox(logfile, &blackbox, sizeof(blackbox)); trace("debugger: done debugging...\n"); + SetEvent(done_event); /* Just exit with a known value */ ExitProcess(0xdeadbeef); @@ -140,7 +159,8 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* debugger) PROCESS_INFORMATION info; STARTUPINFOA startup; DWORD exit_code; - DWORD pid1, pid2; + crash_blackbox_t crash_blackbox; + debugger_blackbox_t dbg_blackbox; ret=RegSetValueExA(hkey, "auto", 0, REG_SZ, (BYTE*)"1", 2); ok(ret == ERROR_SUCCESS, "unable to set AeDebug/auto: ret=%d\n", ret); @@ -180,9 +200,13 @@ static void crash_and_debug(HKEY hkey, const char* argv0, const char* debugger) trace("waiting for the debugger...\n"); ok(WaitForSingleObject(done_event, 60000) == WAIT_OBJECT_0, "Timed out waiting for the debugger\n"); - pid1=get_logged_pid(dbglog); - pid2=get_logged_pid(childlog); - ok(pid1 == pid2, "the child and debugged pids don't match: %d != %d\n", pid1, pid2); + assert(load_blackbox(childlog, &crash_blackbox, sizeof(crash_blackbox))); + assert(load_blackbox(dbglog, &dbg_blackbox, sizeof(dbg_blackbox))); + + ok(dbg_blackbox.argc == 6, "wrong debugger argument count: %d\n", dbg_blackbox.argc); + ok(dbg_blackbox.pid == crash_blackbox.pid, "the child and debugged pids don't match: %d != %d\n", crash_blackbox.pid, dbg_blackbox.pid); + ok(dbg_blackbox.debug_rc, "debugger: SetEvent(debug_event) failed err=%d\n", dbg_blackbox.debug_err); + assert(DeleteFileA(dbglog) != 0); assert(DeleteFileA(childlog) != 0); }
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
...
109
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
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200