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
March
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
February 2008
----- 2025 -----
March 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
999 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11: Add a critical section for the palette global variables instead of relying on the GDI lock .
by Alexandre Julliard
06 Feb '08
06 Feb '08
Module: wine Branch: master Commit: 608b2a94ec74d775ece7648122c704a84dfd7e43 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=608b2a94ec74d775ece764812…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 5 21:57:23 2008 +0100 winex11: Add a critical section for the palette global variables instead of relying on the GDI lock. --- dlls/winex11.drv/palette.c | 44 ++++++++++++++++++++++++++++++++++++-------- 1 files changed, 36 insertions(+), 8 deletions(-) diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c index bb6d493..a2a4046 100644 --- a/dlls/winex11.drv/palette.c +++ b/dlls/winex11.drv/palette.c @@ -85,6 +85,15 @@ static unsigned char X11DRV_PALETTE_freeList[256]; static XContext palette_context; /* X context to associate a color mapping to a palette */ +static CRITICAL_SECTION palette_cs; +static CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &palette_cs, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": palette_cs") } +}; +static CRITICAL_SECTION palette_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; + /**********************************************************************/ /* Map an EGA index (0..15) to a pixel value in the system color space. */ @@ -761,13 +770,19 @@ BOOL X11DRV_IsSolidColor( COLORREF color ) if (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) return TRUE; /* no palette */ + EnterCriticalSection( &palette_cs ); for (i = 0; i < palette_size ; i++, pEntry++) { if( i < COLOR_gapStart || i > COLOR_gapEnd ) if ((GetRValue(color) == pEntry->peRed) && (GetGValue(color) == pEntry->peGreen) && - (GetBValue(color) == pEntry->peBlue)) return TRUE; + (GetBValue(color) == pEntry->peBlue)) + { + LeaveCriticalSection( &palette_cs ); + return TRUE; + } } + LeaveCriticalSection( &palette_cs ); return FALSE; } @@ -810,8 +825,11 @@ COLORREF X11DRV_PALETTE_ToLogical(int pixel) if ((screen_depth <= 8) && (pixel < 256) && !(X11DRV_PALETTE_PaletteFlags & (X11DRV_PALETTE_VIRTUAL | X11DRV_PALETTE_FIXED)) ) { - return ( *(COLORREF*)(COLOR_sysPal + - ((X11DRV_PALETTE_XPixelToPalette)?X11DRV_PALETTE_XPixelToPalette[pixel]:pixel)) ) & 0x00ffffff; + COLORREF ret; + EnterCriticalSection( &palette_cs ); + ret = *(COLORREF *)(COLOR_sysPal + (X11DRV_PALETTE_XPixelToPalette ? X11DRV_PALETTE_XPixelToPalette[pixel]: pixel)) & 0x00ffffff; + LeaveCriticalSection( &palette_cs ); + return ret; } wine_tsx11_lock(); @@ -972,8 +990,10 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color ) ((color >> 8) & 0xff) + (color & 0xff) > 255*3/2) ? white : 1 - white; } + EnterCriticalSection( &palette_cs ); index = X11DRV_SysPaletteLookupPixel( color, FALSE); if (X11DRV_PALETTE_PaletteToXPixel) index = X11DRV_PALETTE_PaletteToXPixel[index]; + LeaveCriticalSection( &palette_cs ); /* TRACE(palette,"RGB(%lx) -> pixel %i\n", color, index); */ @@ -1096,11 +1116,6 @@ UINT X11DRV_RealizePalette( X11DRV_PDEVICE *physDev, HPALETTE hpal, BOOL primary if (!GetObjectW( hpal, sizeof(num_entries), &num_entries )) return 0; - /* reset dynamic system palette entries */ - - if( primary && X11DRV_PALETTE_firstFree != -1) - X11DRV_PALETTE_FormatSystemPalette(); - /* initialize palette mapping table */ prev_mapping = palette_get_mapping( hpal ); if (prev_mapping) @@ -1121,6 +1136,12 @@ UINT X11DRV_RealizePalette( X11DRV_PDEVICE *physDev, HPALETTE hpal, BOOL primary } if (!(num_entries = GetPaletteEntries( hpal, 0, num_entries, entries ))) return 0; + /* reset dynamic system palette entries */ + + EnterCriticalSection( &palette_cs ); + if( primary && X11DRV_PALETTE_firstFree != -1) + X11DRV_PALETTE_FormatSystemPalette(); + for (i = 0; i < num_entries; i++) { index = -1; @@ -1193,6 +1214,7 @@ UINT X11DRV_RealizePalette( X11DRV_PDEVICE *physDev, HPALETTE hpal, BOOL primary TRACE("entry %i (%x) -> pixel %i\n", i, *(COLORREF*)&entries[i], index); } + LeaveCriticalSection( &palette_cs ); return iRemapped; } @@ -1227,6 +1249,7 @@ UINT X11DRV_GetSystemPaletteEntries( X11DRV_PDEVICE *physDev, UINT start, UINT c if (start >= palette_size) return 0; if (start + count >= palette_size) count = palette_size - start; + EnterCriticalSection( &palette_cs ); for (i = 0; i < count; i++) { entries[i].peRed = COLOR_sysPal[start + i].peRed; @@ -1235,6 +1258,7 @@ UINT X11DRV_GetSystemPaletteEntries( X11DRV_PDEVICE *physDev, UINT start, UINT c entries[i].peFlags = 0; TRACE("\tidx(%02x) -> RGB(%08x)\n", start + i, *(COLORREF*)(entries + i) ); } + LeaveCriticalSection( &palette_cs ); return count; } @@ -1272,7 +1296,9 @@ COLORREF X11DRV_GetNearestColor( X11DRV_PDEVICE *physDev, COLORREF color ) color = RGB( entry.peRed, entry.peGreen, entry.peBlue ); } color &= 0x00ffffff; + EnterCriticalSection( &palette_cs ); nearest = (0x00ffffff & *(COLORREF*)(COLOR_sysPal + X11DRV_SysPaletteLookupPixel(color, FALSE))); + LeaveCriticalSection( &palette_cs ); TRACE("(%06x): returning %06x\n", color, nearest ); return nearest; @@ -1293,6 +1319,7 @@ UINT X11DRV_RealizeDefaultPalette( X11DRV_PDEVICE *physDev ) PALETTEENTRY entries[NB_RESERVED_COLORS]; GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, NB_RESERVED_COLORS, entries ); + EnterCriticalSection( &palette_cs ); for( i = 0; i < NB_RESERVED_COLORS; i++ ) { index = X11DRV_PALETTE_LookupSystemXPixel( RGB(entries[i].peRed, @@ -1305,6 +1332,7 @@ UINT X11DRV_RealizeDefaultPalette( X11DRV_PDEVICE *physDev ) ret++; } } + LeaveCriticalSection( &palette_cs ); } return ret; }
1
0
0
0
Alexandre Julliard : gdi32: Get rid of DC_GetDCPtr in the GDI object functions.
by Alexandre Julliard
06 Feb '08
06 Feb '08
Module: wine Branch: master Commit: 8815e63835c09af0fcbcec72568e4ba16eaaa1ff URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8815e63835c09af0fcbcec725…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 5 21:17:28 2008 +0100 gdi32: Get rid of DC_GetDCPtr in the GDI object functions. --- dlls/gdi32/brush.c | 18 +++++++++++++----- dlls/gdi32/gdiobj.c | 41 ++++++++++++++++------------------------- dlls/gdi32/pen.c | 24 ++++++++++++++++++------ 3 files changed, 47 insertions(+), 36 deletions(-) diff --git a/dlls/gdi32/brush.c b/dlls/gdi32/brush.c index 54129c7..95da9b1 100644 --- a/dlls/gdi32/brush.c +++ b/dlls/gdi32/brush.c @@ -374,22 +374,30 @@ static HGDIOBJ BRUSH_SelectObject( HGDIOBJ handle, HDC hdc ) HGDIOBJ ret = 0; DC *dc = get_dc_ptr( hdc ); - if (!dc) return 0; + if (!dc) + { + SetLastError( ERROR_INVALID_HANDLE ); + return 0; + } if ((brush = GDI_GetObjPtr( handle, BRUSH_MAGIC ))) { if (brush->logbrush.lbStyle == BS_PATTERN) BITMAP_SetOwnerDC( (HBITMAP)brush->logbrush.lbHatch, dc ); - if (dc->funcs->pSelectBrush) handle = dc->funcs->pSelectBrush( dc->physDev, handle ); - if (handle) + GDI_inc_ref_count( handle ); + GDI_ReleaseObj( handle ); + + if (dc->funcs->pSelectBrush && !dc->funcs->pSelectBrush( dc->physDev, handle )) + { + GDI_dec_ref_count( handle ); + } + else { ret = dc->hBrush; dc->hBrush = handle; - GDI_inc_ref_count( handle ); GDI_dec_ref_count( ret ); } - GDI_ReleaseObj( handle ); } release_dc_ptr( dc ); return ret; diff --git a/dlls/gdi32/gdiobj.c b/dlls/gdi32/gdiobj.c index 91cfb71..e2c9533 100644 --- a/dlls/gdi32/gdiobj.c +++ b/dlls/gdi32/gdiobj.c @@ -823,7 +823,7 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj ) while (header->hdcs) { - DC *dc = DC_GetDCPtr(header->hdcs->hdc); + DC *dc = get_dc_ptr(header->hdcs->hdc); struct hdc_list *tmp; TRACE("hdc %p has interest in %p\n", header->hdcs->hdc, obj); @@ -831,7 +831,7 @@ BOOL WINAPI DeleteObject( HGDIOBJ obj ) { if(dc->funcs->pDeleteObject) dc->funcs->pDeleteObject( dc->physDev, obj ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); } tmp = header->hdcs; header->hdcs = header->hdcs->next; @@ -1098,10 +1098,10 @@ DWORD WINAPI GetObjectType( HGDIOBJ handle ) HGDIOBJ WINAPI GetCurrentObject(HDC hdc,UINT type) { HGDIOBJ ret = 0; - DC * dc = DC_GetDCPtr( hdc ); + DC * dc = get_dc_ptr( hdc ); + + if (!dc) return 0; - if (dc) - { switch (type) { case OBJ_EXTPEN: /* fall through */ case OBJ_PEN: ret = dc->hPen; break; @@ -1112,13 +1112,12 @@ HGDIOBJ WINAPI GetCurrentObject(HDC hdc,UINT type) /* tests show that OBJ_REGION is explicitly ignored */ case OBJ_REGION: break; - default: - /* the SDK only mentions those above */ - FIXME("(%p,%d): unknown type.\n",hdc,type); + default: + /* the SDK only mentions those above */ + FIXME("(%p,%d): unknown type.\n",hdc,type); break; - } - DC_ReleaseDCPtr( dc ); } + release_dc_ptr( dc ); return ret; } @@ -1143,23 +1142,15 @@ HGDIOBJ WINAPI SelectObject( HDC hdc, HGDIOBJ hObj ) { HGDIOBJ ret = 0; GDIOBJHDR *header; - DC *dc; TRACE( "(%p,%p)\n", hdc, hObj ); - if (!(dc = DC_GetDCPtr( hdc ))) - SetLastError( ERROR_INVALID_HANDLE ); - else + header = GDI_GetObjPtr( hObj, MAGIC_DONTCARE ); + if (header) { - DC_ReleaseDCPtr( dc ); - - header = GDI_GetObjPtr( hObj, MAGIC_DONTCARE ); - if (header) - { - const struct gdi_obj_funcs *funcs = header->funcs; - GDI_ReleaseObj( hObj ); - if (funcs && funcs->pSelectObject) ret = funcs->pSelectObject( hObj, hdc ); - } + const struct gdi_obj_funcs *funcs = header->funcs; + GDI_ReleaseObj( hObj ); + if (funcs && funcs->pSelectObject) ret = funcs->pSelectObject( hObj, hdc ); } return ret; } @@ -1437,13 +1428,13 @@ BOOL WINAPI GetColorAdjustment(HDC hdc, LPCOLORADJUSTMENT lpca) */ BOOL WINAPI GdiComment(HDC hdc, UINT cbSize, const BYTE *lpData) { - DC *dc = DC_GetDCPtr(hdc); + DC *dc = get_dc_ptr(hdc); BOOL ret = FALSE; if(dc) { if (dc->funcs->pGdiComment) ret = dc->funcs->pGdiComment( dc->physDev, cbSize, lpData ); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); } return ret; } diff --git a/dlls/gdi32/pen.c b/dlls/gdi32/pen.c index 5647d7e..971dadd 100644 --- a/dlls/gdi32/pen.c +++ b/dlls/gdi32/pen.c @@ -218,19 +218,31 @@ HPEN WINAPI ExtCreatePen( DWORD style, DWORD width, static HGDIOBJ PEN_SelectObject( HGDIOBJ handle, HDC hdc ) { HGDIOBJ ret = 0; - DC *dc = DC_GetDCPtr( hdc ); + DC *dc = get_dc_ptr( hdc ); - if (!dc) return 0; + if (!dc) + { + SetLastError( ERROR_INVALID_HANDLE ); + return 0; + } + + if (!GDI_inc_ref_count( handle )) + { + release_dc_ptr( dc ); + return 0; + } - if (dc->funcs->pSelectPen) handle = dc->funcs->pSelectPen( dc->physDev, handle ); - if (handle) + if (dc->funcs->pSelectPen && !dc->funcs->pSelectPen( dc->physDev, handle )) + { + GDI_dec_ref_count( handle ); + } + else { ret = dc->hPen; dc->hPen = handle; - GDI_inc_ref_count( handle ); GDI_dec_ref_count( ret ); } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; }
1
0
0
0
Alexandre Julliard : gdi32: Get rid of DC_GetDCPtr in font functions.
by Alexandre Julliard
06 Feb '08
06 Feb '08
Module: wine Branch: master Commit: 4b14a080feeaa6e9a1481c7a8df8178f79aee69a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4b14a080feeaa6e9a1481c7a8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 5 21:16:27 2008 +0100 gdi32: Get rid of DC_GetDCPtr in font functions. --- dlls/gdi32/font.c | 106 ++++++++++++++++++---------------------------------- 1 files changed, 37 insertions(+), 69 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=4b14a080feeaa6e9a1481…
1
0
0
0
Alexandre Julliard : gdi32: Use a separate critical section for freetype locking instead of relying on the GDI lock .
by Alexandre Julliard
06 Feb '08
06 Feb '08
Module: wine Branch: master Commit: 35c09c01b20b9a568f41f690cddb72dd6890e3ee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=35c09c01b20b9a568f41f690c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 5 21:16:06 2008 +0100 gdi32: Use a separate critical section for freetype locking instead of relying on the GDI lock. --- dlls/gdi32/freetype.c | 143 +++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 120 insertions(+), 23 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=35c09c01b20b9a568f41f…
1
0
0
0
Alexandre Julliard : gdi32: Avoid locking in BITMAP_CopyBitmap.
by Alexandre Julliard
06 Feb '08
06 Feb '08
Module: wine Branch: master Commit: 31576d408eba55382306099d6eb52df4622f65da URL:
http://source.winehq.org/git/wine.git/?a=commit;h=31576d408eba55382306099d6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 5 18:26:25 2008 +0100 gdi32: Avoid locking in BITMAP_CopyBitmap. --- dlls/gdi32/bitmap.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index a873457..c468920 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -510,14 +510,10 @@ LONG WINAPI SetBitmapBits( */ HBITMAP BITMAP_CopyBitmap(HBITMAP hbitmap) { - BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); HBITMAP res = 0; BITMAP bm; - if(!bmp) return 0; - - bm = bmp->bitmap; - bm.bmBits = NULL; + if (!GetObjectW( hbitmap, sizeof(bm), &bm )) return 0; res = CreateBitmapIndirect(&bm); if(res) { @@ -527,8 +523,6 @@ HBITMAP BITMAP_CopyBitmap(HBITMAP hbitmap) SetBitmapBits (res, bm.bmWidthBytes * bm.bmHeight, buf); HeapFree( GetProcessHeap(), 0, buf ); } - - GDI_ReleaseObj( hbitmap ); return res; }
1
0
0
0
Alexandre Julliard : gdi32: Don't hold the GDI lock when calling DC_InitDC.
by Alexandre Julliard
06 Feb '08
06 Feb '08
Module: wine Branch: master Commit: 630c976f8829a0a338373ca212f2e12de1c88f53 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=630c976f8829a0a338373ca21…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 5 18:26:18 2008 +0100 gdi32: Don't hold the GDI lock when calling DC_InitDC. --- dlls/gdi32/bitmap.c | 27 ++++++++++++++++----------- 1 files changed, 16 insertions(+), 11 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index de2fdae..a873457 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -576,13 +576,8 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc ) BITMAPOBJ *bitmap; DC *dc; - if (!(bitmap = GDI_GetObjPtr( handle, BITMAP_MAGIC ))) return 0; + if (!(dc = get_dc_ptr( hdc ))) return 0; - if (!(dc = get_dc_ptr( hdc ))) - { - GDI_ReleaseObj( handle ); - return 0; - } if (GetObjectType( hdc ) != OBJ_MEMDC) { ret = 0; @@ -591,34 +586,44 @@ static HGDIOBJ BITMAP_SelectObject( HGDIOBJ handle, HDC hdc ) ret = dc->hBitmap; if (handle == dc->hBitmap) goto done; /* nothing to do */ + if (!(bitmap = GDI_GetObjPtr( handle, BITMAP_MAGIC ))) + { + ret = 0; + goto done; + } + if (bitmap->header.dwCount && (handle != GetStockObject(DEFAULT_BITMAP))) { WARN( "Bitmap already selected in another DC\n" ); + GDI_ReleaseObj( handle ); ret = 0; goto done; } if (!bitmap->funcs && !BITMAP_SetOwnerDC( handle, dc )) { + GDI_ReleaseObj( handle ); ret = 0; goto done; } - if (dc->funcs->pSelectBitmap) handle = dc->funcs->pSelectBitmap( dc->physDev, handle ); - - if (handle) + if (dc->funcs->pSelectBitmap && !dc->funcs->pSelectBitmap( dc->physDev, handle )) + { + GDI_ReleaseObj( handle ); + ret = 0; + } + else { dc->hBitmap = handle; GDI_inc_ref_count( handle ); dc->dirty = 0; SetRectRgn( dc->hVisRgn, 0, 0, bitmap->bitmap.bmWidth, bitmap->bitmap.bmHeight); + GDI_ReleaseObj( handle ); DC_InitDC( dc ); GDI_dec_ref_count( ret ); } - else ret = 0; done: - GDI_ReleaseObj( handle ); release_dc_ptr( dc ); return ret; }
1
0
0
0
Alexandre Julliard : gdi32: Get rid of a few more uses of DC_GetDCPtr.
by Alexandre Julliard
06 Feb '08
06 Feb '08
Module: wine Branch: master Commit: 67a9edbdf473b34290daf0f7ab4906bb73f3c715 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=67a9edbdf473b34290daf0f7a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 5 17:35:40 2008 +0100 gdi32: Get rid of a few more uses of DC_GetDCPtr. --- dlls/gdi32/brush.c | 4 ++-- dlls/gdi32/dib.c | 16 ++++++++-------- dlls/gdi32/font.c | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dlls/gdi32/brush.c b/dlls/gdi32/brush.c index c713f74..54129c7 100644 --- a/dlls/gdi32/brush.c +++ b/dlls/gdi32/brush.c @@ -336,7 +336,7 @@ HBRUSH WINAPI CreateSolidBrush( COLORREF color ) */ BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg ) { - DC *dc = DC_GetDCPtr( hdc ); + DC *dc = get_dc_ptr( hdc ); if (!dc) return FALSE; if (oldorg) @@ -346,7 +346,7 @@ BOOL WINAPI SetBrushOrgEx( HDC hdc, INT x, INT y, LPPOINT oldorg ) } dc->brushOrgX = x; dc->brushOrgY = y; - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return TRUE; } diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 9f7aa4e..e8b3dc9 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -376,7 +376,7 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA UINT result = 0; BITMAPOBJ * bitmap; - if (!(dc = DC_GetDCPtr( hdc ))) return 0; + if (!(dc = get_dc_ptr( hdc ))) return 0; if ((bitmap = GDI_GetObjPtr( dc->hBitmap, BITMAP_MAGIC ))) { @@ -396,7 +396,7 @@ UINT WINAPI SetDIBColorTable( HDC hdc, UINT startpos, UINT entries, CONST RGBQUA if (dc->funcs->pSetDIBColorTable) dc->funcs->pSetDIBColorTable(dc->physDev, startpos, entries, colors); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return result; } @@ -409,7 +409,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col DC * dc; UINT result = 0; - if (!(dc = DC_GetDCPtr( hdc ))) return 0; + if (!(dc = get_dc_ptr( hdc ))) return 0; if (dc->funcs->pGetDIBColorTable) result = dc->funcs->pGetDIBColorTable(dc->physDev, startpos, entries, colors); @@ -431,7 +431,7 @@ UINT WINAPI GetDIBColorTable( HDC hdc, UINT startpos, UINT entries, RGBQUAD *col GDI_ReleaseObj( dc->hBitmap ); } } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return result; } @@ -1075,14 +1075,14 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header, { if (init == CBM_INIT) SetDIBits( hdc, handle, 0, height, bits, data, coloruse ); - else if (hdc && ((dc = DC_GetDCPtr( hdc )) != NULL) ) + else if (hdc && ((dc = get_dc_ptr( hdc )) != NULL) ) { if (!BITMAP_SetOwnerDC( handle, dc )) { DeleteObject( handle ); handle = 0; } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); } } @@ -1323,7 +1323,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, bDesktopDC = TRUE; } - if (!(dc = DC_GetDCPtr( hdc ))) goto error; + if (!(dc = get_dc_ptr( hdc ))) goto error; /* create Device Dependent Bitmap and add DIB pointer */ ret = CreateBitmap( dib->dsBm.bmWidth, dib->dsBm.bmHeight, 1, @@ -1347,7 +1347,7 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage, } } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); if (bDesktopDC) DeleteDC( hdc ); if (ret && bits) *bits = dib->dsBm.bmBits; return ret; diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 5cec471..0db9fbc 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1006,10 +1006,10 @@ INT WINAPI EnumFontsW( HDC hDC, LPCWSTR lpName, FONTENUMPROCW efproc, INT WINAPI GetTextCharacterExtra( HDC hdc ) { INT ret; - DC *dc = DC_GetDCPtr( hdc ); + DC *dc = get_dc_ptr( hdc ); if (!dc) return 0x80000000; ret = dc->charExtra; - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -1020,7 +1020,7 @@ INT WINAPI GetTextCharacterExtra( HDC hdc ) INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra ) { INT prev; - DC * dc = DC_GetDCPtr( hdc ); + DC * dc = get_dc_ptr( hdc ); if (!dc) return 0x80000000; if (dc->funcs->pSetTextCharacterExtra) prev = dc->funcs->pSetTextCharacterExtra( dc->physDev, extra ); @@ -1029,7 +1029,7 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra ) prev = dc->charExtra; dc->charExtra = extra; } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return prev; } @@ -1040,7 +1040,7 @@ INT WINAPI SetTextCharacterExtra( HDC hdc, INT extra ) BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks ) { BOOL ret = TRUE; - DC * dc = DC_GetDCPtr( hdc ); + DC * dc = get_dc_ptr( hdc ); if (!dc) return FALSE; if (dc->funcs->pSetTextJustification) ret = dc->funcs->pSetTextJustification( dc->physDev, extra, breaks ); @@ -1059,7 +1059,7 @@ BOOL WINAPI SetTextJustification( HDC hdc, INT extra, INT breaks ) dc->breakRem = 0; } } - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; } @@ -2425,7 +2425,7 @@ BOOL WINAPI PolyTextOutW( HDC hdc, const POLYTEXTW *pptxt, INT cStrings ) */ DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag ) { - DC *dc = DC_GetDCPtr( hDC ); + DC *dc = get_dc_ptr( hDC ); DWORD ret = 0; if(!dc) return 0; if(dc->funcs->pSetMapperFlags) @@ -2435,7 +2435,7 @@ DWORD WINAPI SetMapperFlags( HDC hDC, DWORD dwFlag ) } else FIXME("(%p, 0x%08x): stub - harmless\n", hDC, dwFlag); - DC_ReleaseDCPtr( dc ); + release_dc_ptr( dc ); return ret; }
1
0
0
0
Alexandre Julliard : gdi32: Avoid locking in CreateCompatibleBitmap.
by Alexandre Julliard
06 Feb '08
06 Feb '08
Module: wine Branch: master Commit: b962fca75cf7eae854e3240cf5be89c14b6a2ded URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b962fca75cf7eae854e3240cf…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Feb 5 17:34:56 2008 +0100 gdi32: Avoid locking in CreateCompatibleBitmap. --- dlls/gdi32/bitmap.c | 35 +++++++++++++++++------------------ 1 files changed, 17 insertions(+), 18 deletions(-) diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index 55b3236..de2fdae 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -132,13 +132,10 @@ HBITMAP WINAPI CreateBitmap( INT width, INT height, UINT planes, HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height) { HBITMAP hbmpRet = 0; - DC *dc; TRACE("(%p,%d,%d) =\n", hdc, width, height); - if (!(dc = DC_GetDCPtr(hdc))) return 0; - - if (GDIMAGIC( dc->header.wMagic ) != MEMORY_DC_MAGIC) + if (GetObjectType( hdc ) != OBJ_MEMDC) { hbmpRet = CreateBitmap(width, height, GetDeviceCaps(hdc, PLANES), @@ -147,14 +144,18 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height) } else /* Memory DC */ { - BITMAPOBJ *bmp = GDI_GetObjPtr( dc->hBitmap, BITMAP_MAGIC ); + DIBSECTION dib; + HBITMAP bitmap = GetCurrentObject( hdc, OBJ_BITMAP ); + INT size = GetObjectW( bitmap, sizeof(dib), &dib ); + + if (!size) return 0; - if (!bmp->dib) + if (size == sizeof(BITMAP)) { /* A device-dependent bitmap is selected in the DC */ hbmpRet = CreateBitmap(width, height, - bmp->bitmap.bmPlanes, - bmp->bitmap.bmBitsPixel, + dib.dsBm.bmPlanes, + dib.dsBm.bmBitsPixel, NULL); } else @@ -174,19 +175,19 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height) bi->bmiHeader.biSize = sizeof(bi->bmiHeader); bi->bmiHeader.biWidth = width; bi->bmiHeader.biHeight = height; - bi->bmiHeader.biPlanes = bmp->dib->dsBmih.biPlanes; - bi->bmiHeader.biBitCount = bmp->dib->dsBmih.biBitCount; - bi->bmiHeader.biCompression = bmp->dib->dsBmih.biCompression; + bi->bmiHeader.biPlanes = dib.dsBmih.biPlanes; + bi->bmiHeader.biBitCount = dib.dsBmih.biBitCount; + bi->bmiHeader.biCompression = dib.dsBmih.biCompression; bi->bmiHeader.biSizeImage = 0; - bi->bmiHeader.biXPelsPerMeter = bmp->dib->dsBmih.biXPelsPerMeter; - bi->bmiHeader.biYPelsPerMeter = bmp->dib->dsBmih.biYPelsPerMeter; - bi->bmiHeader.biClrUsed = bmp->dib->dsBmih.biClrUsed; - bi->bmiHeader.biClrImportant = bmp->dib->dsBmih.biClrImportant; + bi->bmiHeader.biXPelsPerMeter = dib.dsBmih.biXPelsPerMeter; + bi->bmiHeader.biYPelsPerMeter = dib.dsBmih.biYPelsPerMeter; + bi->bmiHeader.biClrUsed = dib.dsBmih.biClrUsed; + bi->bmiHeader.biClrImportant = dib.dsBmih.biClrImportant; if (bi->bmiHeader.biCompression == BI_BITFIELDS) { /* Copy the color masks */ - CopyMemory(bi->bmiColors, bmp->dib->dsBitfields, 3 * sizeof(DWORD)); + CopyMemory(bi->bmiColors, dib.dsBitfields, 3 * sizeof(DWORD)); } else if (bi->bmiHeader.biBitCount <= 8) { @@ -198,9 +199,7 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height) HeapFree(GetProcessHeap(), 0, bi); } } - GDI_ReleaseObj(dc->hBitmap); } - DC_ReleaseDCPtr( dc ); TRACE("\t\t%p\n", hbmpRet); return hbmpRet;
1
0
0
0
Reece H. Dunn : msxml3: Fix the domdoc test failures.
by Alexandre Julliard
05 Feb '08
05 Feb '08
Module: wine Branch: master Commit: fb36abaee930f8a82fa0c9f7da9b9a523459766a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fb36abaee930f8a82fa0c9f7d…
Author: Reece H. Dunn <msclrhd(a)hotmail.com> Date: Mon Feb 4 22:01:00 2008 +0000 msxml3: Fix the domdoc test failures. --- dlls/msxml3/tests/domdoc.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 6f4f7f2..cbc7c6b 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -1721,6 +1721,7 @@ static void test_XPath(void) ole_expect(IXMLDOMDocument_selectNodes(doc, _bstr_("root//foo:c"), &list), E_FAIL); + VariantClear(&var); todo_wine ole_check(IXMLDOMDocument2_getProperty(doc, _bstr_("SelectionNamespaces"), &var)); todo_wine expect_eq(V_VT(&var), VT_BSTR, int, "%x"); if (V_VT(&var) == VT_BSTR)
1
0
0
0
Francois Gouget : comctl32/tests: Call InitCommonControlsEx() if available, fall back to InitCommonControls() for the older controls, and skip the tests altogether for the newer ones.
by Alexandre Julliard
05 Feb '08
05 Feb '08
Module: wine Branch: master Commit: e5b4c0f84bf54fa52754e249c36ba04d939d8742 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e5b4c0f84bf54fa52754e249c…
Author: Francois Gouget <fgouget(a)free.fr> Date: Tue Feb 5 11:59:47 2008 +0100 comctl32/tests: Call InitCommonControlsEx() if available, fall back to InitCommonControls() for the older controls, and skip the tests altogether for the newer ones. --- dlls/comctl32/tests/comboex.c | 24 +++++++++++++++++++----- dlls/comctl32/tests/datetime.c | 16 +++++++++++++++- dlls/comctl32/tests/header.c | 22 +++++++++++++++++++--- dlls/comctl32/tests/listview.c | 15 ++++++++++++++- dlls/comctl32/tests/monthcal.c | 18 +++++++++++++++--- dlls/comctl32/tests/progress.c | 14 +++++++++++++- dlls/comctl32/tests/rebar.c | 14 +++++++++++++- dlls/comctl32/tests/treeview.c | 15 ++++++++++++++- 8 files changed, 122 insertions(+), 16 deletions(-) diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c index f3f46b3..ad58643 100644 --- a/dlls/comctl32/tests/comboex.c +++ b/dlls/comctl32/tests/comboex.c @@ -187,10 +187,23 @@ static LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, L return 0L; } -static void init(void) { +static int init(void) +{ + HMODULE hComctl32; + BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); WNDCLASSA wc; - - InitCommonControls(); + INITCOMMONCONTROLSEX iccex; + + hComctl32 = GetModuleHandleA("comctl32.dll"); + pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); + if (!pInitCommonControlsEx) + { + skip("InitCommonControlsEx() is missing. Skipping the tests\n"); + return 0; + } + iccex.dwSize = sizeof(iccex); + iccex.dwICC = ICC_USEREX_CLASSES; + pInitCommonControlsEx(&iccex); wc.style = CS_HREDRAW | CS_VREDRAW; wc.cbClsExtra = 0; @@ -209,7 +222,7 @@ static void init(void) { assert(hComboExParentWnd != NULL); hMainHinst = GetModuleHandleA(NULL); - + return 1; } static void cleanup(void) @@ -227,7 +240,8 @@ static void cleanup(void) START_TEST(comboex) { - init(); + if (!init()) + return; test_comboboxex(); diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index d13abc6..73c7af3 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -560,7 +560,21 @@ static void test_datetime_control(void) START_TEST(datetime) { - InitCommonControls(); + HMODULE hComctl32; + BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); + INITCOMMONCONTROLSEX iccex; + + hComctl32 = GetModuleHandleA("comctl32.dll"); + pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); + if (!pInitCommonControlsEx) + { + skip("InitCommonControlsEx() is missing. Skipping the tests\n"); + return; + } + iccex.dwSize = sizeof(iccex); + iccex.dwICC = ICC_DATE_CLASSES; + pInitCommonControlsEx(&iccex); + init_msg_sequences(sequences, NUM_MSG_SEQUENCES); test_datetime_control(); diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index 884d4d5..6f8b462 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -1480,10 +1480,24 @@ static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP return 0L; } -static void init(void) { +static int init(void) +{ + HMODULE hComctl32; + BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); WNDCLASSA wc; + INITCOMMONCONTROLSEX iccex; + + hComctl32 = GetModuleHandleA("comctl32.dll"); + pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); + if (!pInitCommonControlsEx) + { + skip("InitCommonControlsEx() is missing. Skipping the tests\n"); + return 0; + } - InitCommonControls(); + iccex.dwSize = sizeof(iccex); + iccex.dwICC = ICC_USEREX_CLASSES; + pInitCommonControlsEx(&iccex); wc.style = CS_HREDRAW | CS_VREDRAW; wc.cbClsExtra = 0; @@ -1503,13 +1517,15 @@ static void init(void) { NULL, NULL, GetModuleHandleA(NULL), 0); assert(hHeaderParentWnd != NULL); ShowWindow(hHeaderParentWnd, SW_SHOW); + return 1; } START_TEST(header) { HWND parent_hwnd; - init(); + if (!init()) + return; test_header_control(); test_header_order(); diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 30a81a8..6e6f535 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -1040,7 +1040,20 @@ static void test_item_position(void) START_TEST(listview) { - InitCommonControls(); + HMODULE hComctl32; + BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); + + hComctl32 = GetModuleHandleA("comctl32.dll"); + pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); + if (pInitCommonControlsEx) + { + INITCOMMONCONTROLSEX iccex; + iccex.dwSize = sizeof(iccex); + iccex.dwICC = ICC_LISTVIEW_CLASSES; + pInitCommonControlsEx(&iccex); + } + else + InitCommonControls(); init_msg_sequences(sequences, NUM_MSG_SEQUENCES); diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c index 7fe2bd7..d33f07c 100644 --- a/dlls/comctl32/tests/monthcal.c +++ b/dlls/comctl32/tests/monthcal.c @@ -315,7 +315,6 @@ static void test_monthcal(void) SYSTEMTIME st[2], st1[2]; int res, month_range; - InitCommonControls(); hwnd = CreateWindowA(MONTHCAL_CLASSA, "MonthCal", WS_POPUP | WS_VISIBLE, CW_USEDEFAULT, 0, 300, 300, 0, 0, NULL, NULL); ok(hwnd != NULL, "Failed to create MonthCal\n"); @@ -478,8 +477,6 @@ static HWND create_monthcal_control(DWORD style, HWND parent_window) struct subclass_info *info; HWND hwnd; - InitCommonControls(); - info = HeapAlloc(GetProcessHeap(), 0, sizeof(struct subclass_info)); if (!info) return NULL; @@ -1109,7 +1106,22 @@ static void test_monthcal_MaxSelDay(HWND hwnd) START_TEST(monthcal) { + HMODULE hComctl32; + BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); + INITCOMMONCONTROLSEX iccex; HWND hwnd, parent_wnd; + + hComctl32 = GetModuleHandleA("comctl32.dll"); + pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); + if (!pInitCommonControlsEx) + { + skip("InitCommonControlsEx() is missing. Skipping the tests\n"); + return; + } + iccex.dwSize = sizeof(iccex); + iccex.dwICC = ICC_DATE_CLASSES; + pInitCommonControlsEx(&iccex); + test_monthcal(); init_msg_sequences(sequences, NUM_MSG_SEQUENCES); diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c index 2716f33..10bbbef 100644 --- a/dlls/comctl32/tests/progress.c +++ b/dlls/comctl32/tests/progress.c @@ -90,10 +90,22 @@ static void update_window(HWND hWnd) static void init(void) { + HMODULE hComctl32; + BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); WNDCLASSA wc; RECT rect; - InitCommonControls(); + hComctl32 = GetModuleHandleA("comctl32.dll"); + pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); + if (pInitCommonControlsEx) + { + INITCOMMONCONTROLSEX iccex; + iccex.dwSize = sizeof(iccex); + iccex.dwICC = ICC_PROGRESS_CLASS; + pInitCommonControlsEx(&iccex); + } + else + InitCommonControls(); wc.style = CS_HREDRAW | CS_VREDRAW; wc.cbClsExtra = 0; diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c index 6bebeb7..1de9cd2 100644 --- a/dlls/comctl32/tests/rebar.c +++ b/dlls/comctl32/tests/rebar.c @@ -786,11 +786,23 @@ static void bandinfo_test(void) START_TEST(rebar) { + HMODULE hComctl32; + BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); + INITCOMMONCONTROLSEX iccex; WNDCLASSA wc; MSG msg; RECT rc; - InitCommonControls(); + hComctl32 = GetModuleHandleA("comctl32.dll"); + pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); + if (!pInitCommonControlsEx) + { + skip("InitCommonControlsEx() is missing. Skipping the tests\n"); + return; + } + iccex.dwSize = sizeof(iccex); + iccex.dwICC = ICC_COOL_CLASSES; + pInitCommonControlsEx(&iccex); wc.style = CS_HREDRAW | CS_VREDRAW; wc.cbClsExtra = 0; diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 93010d3..c1ba7f3 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -649,10 +649,23 @@ static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa START_TEST(treeview) { + HMODULE hComctl32; + BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); WNDCLASSA wc; MSG msg; - InitCommonControls(); + hComctl32 = GetModuleHandleA("comctl32.dll"); + pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); + if (pInitCommonControlsEx) + { + INITCOMMONCONTROLSEX iccex; + iccex.dwSize = sizeof(iccex); + iccex.dwICC = ICC_TREEVIEW_CLASSES; + pInitCommonControlsEx(&iccex); + } + else + InitCommonControls(); + init_msg_sequences(MsgSequences, NUM_MSG_SEQUENCES); wc.style = CS_HREDRAW | CS_VREDRAW;
1
0
0
0
← Newer
1
...
81
82
83
84
85
86
87
...
100
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
Results per page:
10
25
50
100
200