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
November 2006
----- 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
792 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11.drv: Avoid some direct accesses to the PALETTEOBJ structure.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 385ceeb8bcb0250ac04b586440c7577b840c2a2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=385ceeb8bcb0250ac04b58644…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 13:47:39 2006 +0100 winex11.drv: Avoid some direct accesses to the PALETTEOBJ structure. --- dlls/winex11.drv/palette.c | 79 ++++++++++++++++++++++++------------------- 1 files changed, 44 insertions(+), 35 deletions(-) diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c index 1bf3ec8..519dfe9 100644 --- a/dlls/winex11.drv/palette.c +++ b/dlls/winex11.drv/palette.c @@ -855,8 +855,9 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PD break; case 1: /* PALETTEINDEX */ - - if( idx >= palPtr->logpalette.palNumEntries) + { + PALETTEENTRY entry; + if (!GetPaletteEntries( hPal, idx, 1, &entry )) { WARN("PALETTEINDEX(%x) : idx %d is out of bounds, assuming black\n", color, idx); GDI_ReleaseObj( hPal ); @@ -869,8 +870,9 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PD GDI_ReleaseObj( hPal ); return ret; } - color = *(COLORREF*)(palPtr->logpalette.palPalEntry + idx); + color = RGB( entry.peRed, entry.peGreen, entry.peBlue ); break; + } default: color &= 0xffffff; @@ -1048,10 +1050,9 @@ static BOOL X11DRV_PALETTE_CheckSysColor /*********************************************************************** * X11DRV_LookupSysPaletteExact */ -static int X11DRV_LookupSysPaletteExact( COLORREF col ) +static int X11DRV_LookupSysPaletteExact( BYTE r, BYTE g, BYTE b ) { int i; - BYTE r = GetRValue(col), g = GetGValue(col), b = GetBValue(col); for( i = 0; i < palette_size; i++ ) { if( COLOR_sysPal[i].peFlags & PC_SYS_USED ) /* skips gap */ @@ -1070,13 +1071,17 @@ static int X11DRV_LookupSysPaletteExact( * Set the color-mapping table for selected palette. * Return number of entries which mapping has changed. */ -static UINT X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL mapOnly ) +static UINT X11DRV_PALETTE_SetMapping( HPALETTE hpal, PALETTEOBJ* palPtr, BOOL mapOnly ) { char flag; int prevMapping = (palPtr->mapping) ? 1 : 0; int index; - UINT iRemapped = 0; + UINT i, iRemapped = 0; int* mapping; + PALETTEENTRY entries[256]; + WORD num_entries; + + if (!GetObjectW( hpal, sizeof(num_entries), &num_entries )) return 0; /* reset dynamic system palette entries */ @@ -1085,11 +1090,9 @@ static UINT X11DRV_PALETTE_SetMapping( P /* initialize palette mapping table */ if (palPtr->mapping) - mapping = HeapReAlloc( GetProcessHeap(), 0, palPtr->mapping, - sizeof(int)*palPtr->logpalette.palNumEntries); + mapping = HeapReAlloc( GetProcessHeap(), 0, palPtr->mapping, sizeof(int)*num_entries); else - mapping = HeapAlloc( GetProcessHeap(), 0, - sizeof(int)*palPtr->logpalette.palNumEntries); + mapping = HeapAlloc( GetProcessHeap(), 0, sizeof(int)*num_entries); if(mapping == NULL) { ERR("Unable to allocate new mapping -- memory exhausted!\n"); @@ -1097,12 +1100,14 @@ static UINT X11DRV_PALETTE_SetMapping( P } palPtr->mapping = mapping; - if (uStart >= palPtr->logpalette.palNumEntries) return 0; - - if (uStart + uNum > palPtr->logpalette.palNumEntries) - uNum = palPtr->logpalette.palNumEntries - uStart; + if (num_entries > 256) + { + FIXME( "more than 256 entries not supported\n" ); + num_entries = 256; + } + if (!(num_entries = GetPaletteEntries( hpal, 0, num_entries, entries ))) return 0; - for( uNum += uStart; uStart < uNum; uStart++ ) + for (i = 0; i < num_entries; i++) { index = -1; flag = PC_SYS_USED; @@ -1110,9 +1115,9 @@ static UINT X11DRV_PALETTE_SetMapping( P /* Even though the docs say that only one flag is to be set, * they are a bitmask. At least one app sets more than one at * the same time. */ - if ( palPtr->logpalette.palPalEntry[uStart].peFlags & PC_EXPLICIT ) { + if ( entries[i].peFlags & PC_EXPLICIT ) { /* palette entries are indices into system palette */ - index = *(WORD*)(palPtr->logpalette.palPalEntry + uStart); + index = *(WORD*)&entries[i]; if( index > 255 || (index >= COLOR_gapStart && index <= COLOR_gapEnd) ) { WARN("PC_EXPLICIT: idx %d out of system palette, assuming black.\n", index); @@ -1120,14 +1125,14 @@ static UINT X11DRV_PALETTE_SetMapping( P } if( X11DRV_PALETTE_PaletteToXPixel ) index = X11DRV_PALETTE_PaletteToXPixel[index]; } else { - if ( palPtr->logpalette.palPalEntry[uStart].peFlags & PC_RESERVED ) { + if ( entries[i].peFlags & PC_RESERVED ) { /* forbid future mappings to this entry */ flag |= PC_SYS_RESERVED; } - if (! (palPtr->logpalette.palPalEntry[uStart].peFlags & PC_NOCOLLAPSE) ) { + if (! (entries[i].peFlags & PC_NOCOLLAPSE) ) { /* try to collapse identical colors */ - index = X11DRV_LookupSysPaletteExact(*(COLORREF*)(palPtr->logpalette.palPalEntry + uStart)); + index = X11DRV_LookupSysPaletteExact( entries[i].peRed, entries[i].peGreen, entries[i].peBlue ); } if( index < 0 ) @@ -1139,15 +1144,15 @@ static UINT X11DRV_PALETTE_SetMapping( P X11DRV_PALETTE_firstFree = X11DRV_PALETTE_freeList[index]; color.pixel = (X11DRV_PALETTE_PaletteToXPixel) ? X11DRV_PALETTE_PaletteToXPixel[index] : index; - color.red = palPtr->logpalette.palPalEntry[uStart].peRed << 8; - color.green = palPtr->logpalette.palPalEntry[uStart].peGreen << 8; - color.blue = palPtr->logpalette.palPalEntry[uStart].peBlue << 8; + color.red = entries[i].peRed << 8; + color.green = entries[i].peGreen << 8; + color.blue = entries[i].peBlue << 8; color.flags = DoRed | DoGreen | DoBlue; wine_tsx11_lock(); XStoreColor(gdi_display, X11DRV_PALETTE_PaletteXColormap, &color); wine_tsx11_unlock(); - COLOR_sysPal[index] = palPtr->logpalette.palPalEntry[uStart]; + COLOR_sysPal[index] = entries[i]; COLOR_sysPal[index].peFlags = flag; X11DRV_PALETTE_freeList[index] = 0; @@ -1155,23 +1160,23 @@ static UINT X11DRV_PALETTE_SetMapping( P } else if ( X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL ) { - index = X11DRV_PALETTE_ToPhysical( NULL, 0x00ffffff & - *(COLORREF*)(palPtr->logpalette.palPalEntry + uStart)); + index = X11DRV_PALETTE_ToPhysical( NULL, + RGB( entries[i].peRed, entries[i].peGreen, entries[i].peBlue )); } /* we have to map to existing entry in the system palette */ - index = X11DRV_SysPaletteLookupPixel( *(COLORREF*)(palPtr->logpalette.palPalEntry + uStart), TRUE); + index = X11DRV_SysPaletteLookupPixel( RGB( entries[i].peRed, entries[i].peGreen, entries[i].peBlue ), + TRUE ); } if( X11DRV_PALETTE_PaletteToXPixel ) index = X11DRV_PALETTE_PaletteToXPixel[index]; } - if( !prevMapping || palPtr->mapping[uStart] != index ) iRemapped++; - palPtr->mapping[uStart] = index; + if( !prevMapping || palPtr->mapping[i] != index ) iRemapped++; + palPtr->mapping[i] = index; - TRACE("entry %i (%x) -> pixel %i\n", uStart, - *(COLORREF*)(palPtr->logpalette.palPalEntry + uStart), index); + TRACE("entry %i (%x) -> pixel %i\n", i, *(COLORREF*)&entries[i], index); } return iRemapped; @@ -1252,7 +1257,7 @@ UINT X11DRV_RealizePalette( X11DRV_PDEVI if (X11DRV_PALETTE_PaletteFlags & X11DRV_PALETTE_VIRTUAL) return 0; if (!(palPtr = GDI_GetObjPtr( hpal, PALETTE_MAGIC ))) return 0; - ret = X11DRV_PALETTE_SetMapping( palPtr, 0, palPtr->logpalette.palNumEntries, !primary ); + ret = X11DRV_PALETTE_SetMapping( hpal, palPtr, !primary ); GDI_ReleaseObj( hpal ); return ret; } @@ -1272,10 +1277,14 @@ UINT X11DRV_RealizeDefaultPalette( X11DR { /* lookup is needed to account for SetSystemPaletteUse() stuff */ int i, index; + PALETTEENTRY entries[NB_RESERVED_COLORS]; - for( i = 0; i < 20; i++ ) + GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, NB_RESERVED_COLORS, entries ); + for( i = 0; i < NB_RESERVED_COLORS; i++ ) { - index = X11DRV_PALETTE_LookupSystemXPixel(*(COLORREF*)(palPtr->logpalette.palPalEntry + i)); + index = X11DRV_PALETTE_LookupSystemXPixel( RGB(entries[i].peRed, + entries[i].peGreen, + entries[i].peBlue) ); /* mapping is allocated in COLOR_InitPalette() */ if( index != palPtr->mapping[i] ) {
1
0
0
0
Alexandre Julliard : gdi32: Moved the system palette flags to winex11.drv.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: ed4f22ab5f204742b6e8745c2354a0e3802bdf6a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ed4f22ab5f204742b6e8745c2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 13:13:34 2006 +0100 gdi32: Moved the system palette flags to winex11.drv. --- dlls/gdi32/palette.c | 19 ------------------- dlls/winex11.drv/palette.c | 4 +++- include/gdi.h | 3 --- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/dlls/gdi32/palette.c b/dlls/gdi32/palette.c index 52893a0..c136656 100644 --- a/dlls/gdi32/palette.c +++ b/dlls/gdi32/palette.c @@ -130,16 +130,6 @@ HPALETTE PALETTE_Init(void) return hpalette; } -/*********************************************************************** - * PALETTE_ValidateFlags - */ -static void PALETTE_ValidateFlags(PALETTEENTRY* lpPalE, int size) -{ - int i = 0; - for( ; i<size ; i++ ) - lpPalE[i].peFlags = PC_SYS_USED | (lpPalE[i].peFlags & 0x07); -} - /*********************************************************************** * CreatePalette [GDI32.@] @@ -166,8 +156,6 @@ HPALETTE WINAPI CreatePalette( PALETTE_MAGIC, (HGDIOBJ *)&hpalette, &palette_funcs ))) return 0; memcpy( &palettePtr->logpalette, palette, size ); - PALETTE_ValidateFlags(palettePtr->logpalette.palPalEntry, - palettePtr->logpalette.palNumEntries); palettePtr->mapping = NULL; GDI_ReleaseObj( hpalette ); @@ -358,8 +346,6 @@ UINT WINAPI SetPaletteEntries( if (start+count > numEntries) count = numEntries - start; memcpy( &palPtr->logpalette.palPalEntry[start], entries, count * sizeof(PALETTEENTRY) ); - PALETTE_ValidateFlags(palPtr->logpalette.palPalEntry, - palPtr->logpalette.palNumEntries); UnrealizeObject( hpalette ); GDI_ReleaseObj( hpalette ); return count; @@ -413,8 +399,6 @@ BOOL WINAPI ResizePalette( if( mapping ) memset(palPtr->mapping + cPrevEnt, 0, (cEntries - cPrevEnt)*sizeof(int)); memset( (BYTE*)palPtr + prevsize, 0, size - prevsize ); - PALETTE_ValidateFlags((PALETTEENTRY*)((BYTE*)palPtr + prevsize), - cEntries - cPrevEnt ); } palPtr->logpalette.palNumEntries = cEntries; palPtr->logpalette.palVersion = prevVer; @@ -470,7 +454,6 @@ BOOL WINAPI AnimatePalette( pptr->peRed, pptr->peGreen, pptr->peBlue); memcpy( &palPtr->logpalette.palPalEntry[StartIndex], pptr, sizeof(PALETTEENTRY) ); - PALETTE_ValidateFlags(&palPtr->logpalette.palPalEntry[StartIndex], 1); } else { TRACE("Not animating entry %d -- not PC_RESERVED\n", StartIndex); } @@ -592,8 +575,6 @@ UINT WINAPI GetNearestPaletteIndex( for( i = 0; i < palObj->logpalette.palNumEntries && diff ; i++, entry++) { - if (!(entry->peFlags & PC_SYS_USED)) continue; - r = entry->peRed - GetRValue(color); g = entry->peGreen - GetGValue(color); b = entry->peBlue - GetBValue(color); diff --git a/dlls/winex11.drv/palette.c b/dlls/winex11.drv/palette.c index f7ec7ad..1bf3ec8 100644 --- a/dlls/winex11.drv/palette.c +++ b/dlls/winex11.drv/palette.c @@ -48,6 +48,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(palette); *
http://premium.microsoft.com/msdn/library/techart/f30/f34/f40/d4d/sa942.htm
*/ +#define PC_SYS_USED 0x80 /* palentry is used (both system and logical) */ +#define PC_SYS_RESERVED 0x40 /* system palentry is not to be mapped to */ + static PALETTEENTRY *COLOR_sysPal; /* current system palette */ static int COLOR_gapStart = 256; @@ -1160,7 +1163,6 @@ static UINT X11DRV_PALETTE_SetMapping( P index = X11DRV_SysPaletteLookupPixel( *(COLORREF*)(palPtr->logpalette.palPalEntry + uStart), TRUE); } - palPtr->logpalette.palPalEntry[uStart].peFlags |= PC_SYS_USED; if( X11DRV_PALETTE_PaletteToXPixel ) index = X11DRV_PALETTE_PaletteToXPixel[index]; } diff --git a/include/gdi.h b/include/gdi.h index 190ddd1..49b231f 100644 --- a/include/gdi.h +++ b/include/gdi.h @@ -70,9 +70,6 @@ typedef struct tagGDIOBJHDR #define NB_RESERVED_COLORS 20 /* number of fixed colors in system palette */ -#define PC_SYS_USED 0x80 /* palentry is used (both system and logical) */ -#define PC_SYS_RESERVED 0x40 /* system palentry is not to be mapped to */ - typedef struct tagPALETTEOBJ { GDIOBJHDR header;
1
0
0
0
Alexandre Julliard : gdi32: Avoid accessing the internal palette object from dib.c.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: c60757b7d8b57f4e6b697e9c93cdc275075445a7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c60757b7d8b57f4e6b697e9c9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 14:34:20 2006 +0100 gdi32: Avoid accessing the internal palette object from dib.c. --- dlls/gdi32/dib.c | 44 ++++++++++++++++++++------------------------ 1 files changed, 20 insertions(+), 24 deletions(-) diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index a3d559c..c23e861 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -638,33 +638,33 @@ INT WINAPI GetDIBits( else { if(bpp >= bmp->bitmap.bmBitsPixel) { /* Generate the color map from the selected palette */ - PALETTEENTRY * palEntry; - PALETTEOBJ * palette; - if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC ))) { + PALETTEENTRY palEntry[256]; + + memset( palEntry, 0, sizeof(palEntry) ); + if (!GetPaletteEntries( dc->hPalette, 0, 1 << bmp->bitmap.bmBitsPixel, palEntry )) + { GDI_ReleaseObj( hdc ); GDI_ReleaseObj( hbitmap ); return 0; } - palEntry = palette->logpalette.palPalEntry; - for (i = 0; i < (1 << bmp->bitmap.bmBitsPixel); i++, palEntry++) { + for (i = 0; i < (1 << bmp->bitmap.bmBitsPixel); i++) { if (coloruse == DIB_RGB_COLORS) { if (core_header) { - rgbTriples[i].rgbtRed = palEntry->peRed; - rgbTriples[i].rgbtGreen = palEntry->peGreen; - rgbTriples[i].rgbtBlue = palEntry->peBlue; + rgbTriples[i].rgbtRed = palEntry[i].peRed; + rgbTriples[i].rgbtGreen = palEntry[i].peGreen; + rgbTriples[i].rgbtBlue = palEntry[i].peBlue; } else { - rgbQuads[i].rgbRed = palEntry->peRed; - rgbQuads[i].rgbGreen = palEntry->peGreen; - rgbQuads[i].rgbBlue = palEntry->peBlue; + rgbQuads[i].rgbRed = palEntry[i].peRed; + rgbQuads[i].rgbGreen = palEntry[i].peGreen; + rgbQuads[i].rgbBlue = palEntry[i].peBlue; rgbQuads[i].rgbReserved = 0; } } else ((WORD *)colorPtr)[i] = (WORD)i; } - GDI_ReleaseObj( dc->hPalette ); } else { switch (bpp) { case 1: @@ -1189,21 +1189,17 @@ static void DIB_CopyColorTable( DC *dc, } else { - PALETTEOBJ *palette; + PALETTEENTRY entries[256]; const WORD *index = (const WORD*) ((const BYTE*) info + (WORD) info->bmiHeader.biSize); + UINT count = GetPaletteEntries( dc->hPalette, 0, colors, entries ); - if ((palette = GDI_GetObjPtr( dc->hPalette, PALETTE_MAGIC ))) + for (i = 0; i < colors; i++, index++) { - UINT entries = palette->logpalette.palNumEntries; - for (i = 0; i < colors; i++, index++) - { - PALETTEENTRY *entry = &palette->logpalette.palPalEntry[*index % entries]; - colorTable[i].rgbRed = entry->peRed; - colorTable[i].rgbGreen = entry->peGreen; - colorTable[i].rgbBlue = entry->peBlue; - colorTable[i].rgbReserved = 0; - } - GDI_ReleaseObj( dc->hPalette ); + PALETTEENTRY *entry = &entries[*index % count]; + colorTable[i].rgbRed = entry->peRed; + colorTable[i].rgbGreen = entry->peGreen; + colorTable[i].rgbBlue = entry->peBlue; + colorTable[i].rgbReserved = 0; } } bmp->color_table = colorTable;
1
0
0
0
Alexandre Julliard : d3d9: Include wingdi.h, not gdi.h.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 46dd467941b42ace897938d3abfee5db82d9b84e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=46dd467941b42ace897938d3a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 17 12:46:15 2006 +0100 d3d9: Include wingdi.h, not gdi.h. --- dlls/d3d9/d3d9_private.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index 2d6397e..9f8329d 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -30,11 +30,11 @@ #define COBJMACROS #include "windef.h" #include "winbase.h" +#include "wingdi.h" #include "winuser.h" #include "wine/debug.h" #include "wine/unicode.h" -#include "gdi.h" #include "d3d9.h" #include "ddraw.h" #include "wine/wined3d_interface.h"
1
0
0
0
Andrew Talbot : urlmon: Cast-qual warnings fix.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 60cafb5e952c4bb5c24bd0ad68a28f7937e03361 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=60cafb5e952c4bb5c24bd0ad6…
Author: Andrew Talbot <Andrew.Talbot(a)talbotville.com> Date: Thu Nov 16 21:55:05 2006 +0000 urlmon: Cast-qual warnings fix. --- dlls/urlmon/urlmon_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c index d0d8f2c..d36803c 100644 --- a/dlls/urlmon/urlmon_main.c +++ b/dlls/urlmon/urlmon_main.c @@ -452,7 +452,7 @@ static BOOL image_bmp_filter(const BYTE { return size >= 14 && b[0] == 0x42 && b[1] == 0x4d - && *(DWORD*)(b+6) == 0; + && *(const DWORD *)(b+6) == 0; } static BOOL video_avi_filter(const BYTE const *b, DWORD size)
1
0
0
0
Vitaliy Margolen : winecfg: Allow editing of broken drive links.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 161a53f254887b5a0b52cb37b8f15e20daafa5ab URL:
http://source.winehq.org/git/wine.git/?a=commit;h=161a53f254887b5a0b52cb37b…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Thu Nov 16 12:28:49 2006 -0700 winecfg: Allow editing of broken drive links. --- programs/winecfg/drive.c | 41 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 36 insertions(+), 5 deletions(-) diff --git a/programs/winecfg/drive.c b/programs/winecfg/drive.c index 36d7a1d..9e81ab2 100644 --- a/programs/winecfg/drive.c +++ b/programs/winecfg/drive.c @@ -21,6 +21,9 @@ * */ +#include "config.h" +#include "wine/port.h" + #include <assert.h> #include <stdarg.h> #include <stdio.h> @@ -35,6 +38,7 @@ #include <shlguid.h> #include <shlwapi.h> #include <shlobj.h> +#include <wine/library.h> #include "winecfg.h" #include "resource.h" @@ -263,12 +267,11 @@ void load_drives() int drivecount = 0, i; int retval; static const int arraysize = 512; + const char *config_dir = wine_get_config_dir(); + char *path; WINE_TRACE("\n"); - /* FIXME: broken symlinks in $WINEPREFIX/dosdevices will not be - returned by this API, so we need to handle that */ - /* setup the drives array */ dev = devices = HeapAlloc(GetProcessHeap(), 0, arraysize); len = GetLogicalDriveStrings(arraysize, devices); @@ -360,8 +363,37 @@ void load_drives() drivecount++; } + /* Find all the broken symlinks we might have and add them as well. */ + + len = strlen(config_dir) + sizeof("/dosdevices/a:"); + if (!(path = HeapAlloc(GetProcessHeap(), 0, len))) + return; + + strcpy(path, config_dir); + strcat(path, "/dosdevices/a:"); + + for (i = 0; i < 26; i++) + { + char buff[MAX_PATH]; + struct stat st; + int cnt; + + if (drives[i].in_use) continue; + path[len - 3] = 'a' + i; + + if (lstat(path, &st) == -1 || !S_ISLNK(st.st_mode)) continue; + if ((cnt = readlink(path, buff, sizeof(buff))) == -1) continue; + buff[cnt] = '\0'; + + WINE_TRACE("found broken symlink %s -> %s\n", path, buff); + add_drive('A' + i, buff, "", "0", DRIVE_UNKNOWN); + + drivecount++; + } + WINE_TRACE("found %d drives\n", drivecount); + HeapFree(GetProcessHeap(), 0, path); HeapFree(GetProcessHeap(), 0, dev); } @@ -421,9 +453,8 @@ void apply_drive_changes(void) if(!retval) { WINE_TRACE(" GetVolumeInformation() for '%s' failed\n", devicename); - WINE_TRACE(" Skipping this drive\n"); PRINTERROR(); - continue; /* skip this drive */ + volumeNameBuffer[0] = '\0'; } WINE_TRACE(" current path: '%s', new path: '%s'\n",
1
0
0
0
Louis Lenders : msvcrt: Add _fstat64 and _stat64 to msvcrt.spec.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: fa47970e6c24f51c57023e4596d364bef37f794d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fa47970e6c24f51c57023e459…
Author: Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> Date: Thu Nov 16 11:49:47 2006 +0000 msvcrt: Add _fstat64 and _stat64 to msvcrt.spec. --- dlls/msvcrt/msvcrt.spec | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index eaf9312..0b27bed 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -242,6 +242,7 @@ @ cdecl _fputwchar(long) @ cdecl _fsopen(str str long) MSVCRT__fsopen @ cdecl _fstat(long ptr) MSVCRT__fstat +@ stub _fstat64 @ cdecl _fstati64(long ptr) MSVCRT__fstati64 @ cdecl _ftime(ptr) @ cdecl -ret64 _ftol() ntdll._ftol @@ -449,6 +450,7 @@ @ cdecl _spawnvpe(long str ptr ptr) @ cdecl _splitpath(str ptr ptr ptr ptr) ntdll._splitpath @ cdecl _stat(str ptr) MSVCRT__stat +@ stub _stat64 @ cdecl _stati64(str ptr) MSVCRT__stati64 @ cdecl _statusfp() @ cdecl _strcmpi(str str) ntdll._strcmpi
1
0
0
0
Mike McCormack : msi: Fix a memory leak in load_folder().
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: eba742e5cdfd534f918fa560a50d439c9ffa8d3b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eba742e5cdfd534f918fa560a…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Fri Nov 17 17:50:41 2006 +0900 msi: Fix a memory leak in load_folder(). --- dlls/msi/action.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 7dcb375..1a13fb7 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -1527,16 +1527,16 @@ static MSIFOLDER *load_folder( MSIPACKAG TRACE("Working to load %s\n",debugstr_w(dir)); + row = MSI_QueryGetRecord(package->db, Query, dir); + if (!row) + return NULL; + folder = msi_alloc_zero( sizeof (MSIFOLDER) ); if (!folder) return NULL; folder->Directory = strdupW(dir); - row = MSI_QueryGetRecord(package->db, Query, dir); - if (!row) - return NULL; - p = msi_dup_record_field(row, 3); /* split src and target dir */
1
0
0
0
Mike McCormack : msi: Remove unnecessary includes.
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: cf370a8d395d6d93f77546f8768e53f4e4a0aa97 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cf370a8d395d6d93f77546f87…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Fri Nov 17 15:16:13 2006 +0900 msi: Remove unnecessary includes. --- dlls/msi/custom.c | 22 ++-------------------- 1 files changed, 2 insertions(+), 20 deletions(-) diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c index 14e9918..bbc56a8 100644 --- a/dlls/msi/custom.c +++ b/dlls/msi/custom.c @@ -18,35 +18,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -/* - * Pages I need - * -http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/summary_list_of_all_custom_action_types.asp - */ - -#include <stdarg.h> -#include <stdio.h> - #define COBJMACROS +#include <stdarg.h> #include "windef.h" #include "winbase.h" #include "winerror.h" -#include "winreg.h" -#include "wine/debug.h" -#include "fdi.h" -#include "msi.h" #include "msidefs.h" -#include "msiquery.h" -#include "msvcrt/fcntl.h" -#include "objbase.h" -#include "objidl.h" #include "msipriv.h" -#include "winnls.h" #include "winuser.h" -#include "shlobj.h" +#include "wine/debug.h" #include "wine/unicode.h" -#include "winver.h" WINE_DEFAULT_DEBUG_CHANNEL(msi);
1
0
0
0
Mike McCormack : msi: Remove a level of indent in resolve_folder().
by Alexandre Julliard
17 Nov '06
17 Nov '06
Module: wine Branch: master Commit: 6b38139e6268e82ec3269497f3a38b0080c13578 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b38139e6268e82ec3269497f…
Author: Mike McCormack <mike(a)codeweavers.com> Date: Fri Nov 17 15:15:56 2006 +0900 msi: Remove a level of indent in resolve_folder(). --- dlls/msi/helpers.c | 87 ++++++++++++++++++++++++++------------------------- 1 files changed, 44 insertions(+), 43 deletions(-) diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c index 82f98b6..ebd0301 100644 --- a/dlls/msi/helpers.c +++ b/dlls/msi/helpers.c @@ -201,7 +201,7 @@ LPWSTR resolve_folder(MSIPACKAGE *packag BOOL set_prop, MSIFOLDER **folder) { MSIFOLDER *f; - LPWSTR p, path = NULL; + LPWSTR p, path = NULL, parent; TRACE("Working to resolve %s\n",debugstr_w(name)); @@ -267,60 +267,61 @@ LPWSTR resolve_folder(MSIPACKAGE *packag return path; } - if (f->Parent) - { - LPWSTR parent = f->Parent->Directory; + if (!f->Parent) + return path; - TRACE(" ! Parent is %s\n", debugstr_w(parent)); + parent = f->Parent->Directory; - p = resolve_folder(package, parent, source, set_prop, NULL); - if (!source) - { - TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault)); + TRACE(" ! Parent is %s\n", debugstr_w(parent)); - path = build_directory_name( 3, p, f->TargetDefault, NULL ); - clean_spaces_from_path( path ); - f->ResolvedTarget = strdupW( path ); - TRACE("target -> %s\n", debugstr_w(path)); - if (set_prop) - MSI_SetPropertyW(package,name,path); - } - else - { - /* source may be in a few different places ... check each of them */ - path = NULL; + p = resolve_folder(package, parent, source, set_prop, NULL); + if (!source) + { + TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault)); - /* try the long path directory */ - if (f->SourceLongPath) + path = build_directory_name( 3, p, f->TargetDefault, NULL ); + clean_spaces_from_path( path ); + f->ResolvedTarget = strdupW( path ); + TRACE("target -> %s\n", debugstr_w(path)); + if (set_prop) + MSI_SetPropertyW(package,name,path); + } + else + { + /* source may be in a few different places ... check each of them */ + path = NULL; + + /* try the long path directory */ + if (f->SourceLongPath) + { + path = build_directory_name( 3, p, f->SourceLongPath, NULL ); + if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path )) { - path = build_directory_name( 3, p, f->SourceLongPath, NULL ); - if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path )) - { - msi_free( path ); - path = NULL; - } + msi_free( path ); + path = NULL; } + } - /* try the short path directory */ - if (!path && f->SourceShortPath) + /* try the short path directory */ + if (!path && f->SourceShortPath) + { + path = build_directory_name( 3, p, f->SourceShortPath, NULL ); + if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path )) { - path = build_directory_name( 3, p, f->SourceShortPath, NULL ); - if (INVALID_FILE_ATTRIBUTES == GetFileAttributesW( path )) - { - msi_free( path ); - path = NULL; - } + msi_free( path ); + path = NULL; } + } - /* try the root of the install */ - if (!path) - path = get_source_root( package ); + /* try the root of the install */ + if (!path) + path = get_source_root( package ); - TRACE("source -> %s\n", debugstr_w(path)); - f->ResolvedSource = strdupW( path ); - } - msi_free(p); + TRACE("source -> %s\n", debugstr_w(path)); + f->ResolvedSource = strdupW( path ); } + msi_free(p); + return path; }
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
80
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
Results per page:
10
25
50
100
200