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
May 2011
----- 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
2 participants
945 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11: Set the desktop window gravity to NorthWest to avoid spurious position changes .
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: 2e46c671d69f8ec3b013a832fc92a05fdd198a45 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2e46c671d69f8ec3b013a832f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 12 16:25:50 2011 +0200 winex11: Set the desktop window gravity to NorthWest to avoid spurious position changes. --- dlls/winex11.drv/window.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 9e67612..6a87afc 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -982,6 +982,7 @@ static void set_size_hints( Display *display, struct x11drv_win_data *data, DWOR size_hints->y = data->whole_rect.top; size_hints->flags |= PPosition; } + else size_hints->win_gravity = NorthWestGravity; if (!is_window_resizable( data, style )) {
1
0
0
0
Alexandre Julliard : winex11: Only update the fullscreen pointer grab when something has changed.
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: b081ee452d7ff78c5db01bb635a6528e4f33afda URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b081ee452d7ff78c5db01bb63…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 12 16:24:58 2011 +0200 winex11: Only update the fullscreen pointer grab when something has changed. --- dlls/winex11.drv/desktop.c | 2 +- dlls/winex11.drv/event.c | 2 +- dlls/winex11.drv/mouse.c | 17 ++++++++++++----- dlls/winex11.drv/x11drv.h | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index b45f786..acba18b 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -200,7 +200,7 @@ static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam DefaultScreen(display), mask, &changes ); wine_tsx11_unlock(); } - if (hwnd == GetForegroundWindow()) clip_fullscreen_window( hwnd ); + if (hwnd == GetForegroundWindow()) clip_fullscreen_window( hwnd, TRUE ); return TRUE; } diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index d2ab40a..6ef1e07 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -716,7 +716,7 @@ static void X11DRV_FocusIn( HWND hwnd, XEvent *xev ) } if (use_take_focus) { - if (hwnd == GetForegroundWindow()) clip_fullscreen_window( hwnd ); + if (hwnd == GetForegroundWindow()) clip_fullscreen_window( hwnd, FALSE ); return; } diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 3e1a78f..5fd7338 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -419,11 +419,11 @@ static BOOL grab_clipping_window( const RECT *clip, BOOL only_with_xinput ) if (msg_hwnd) DestroyWindow( msg_hwnd ); return FALSE; } + clip_rect = *clip; if (msg_hwnd) { data->clip_hwnd = msg_hwnd; sync_window_cursor( clip_window ); - clip_rect = *clip; SendMessageW( GetDesktopWindow(), WM_X11DRV_CLIP_CURSOR, 0, (LPARAM)msg_hwnd ); } return TRUE; @@ -502,9 +502,10 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd ) * * Turn on clipping if the active window is fullscreen. */ -BOOL clip_fullscreen_window( HWND hwnd ) +BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) { struct x11drv_win_data *data; + struct x11drv_thread_data *thread_data; RECT rect; DWORD style; @@ -516,7 +517,9 @@ BOOL clip_fullscreen_window( HWND hwnd ) /* maximized windows don't count as full screen */ if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) return FALSE; if (!is_window_rect_fullscreen( &data->whole_rect )) return FALSE; - if (GetTickCount() - x11drv_thread_data()->clip_reset < 1000) return FALSE; + if (!(thread_data = x11drv_thread_data())) return FALSE; + if (GetTickCount() - thread_data->clip_reset < 1000) return FALSE; + if (!reset && thread_data->clip_hwnd) return FALSE; /* already clipping */ SetRect( &rect, 0, 0, screen_width, screen_height ); if (!grab_fullscreen) { @@ -576,7 +579,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU { hwnd = GetAncestor( hwnd, GA_ROOT ); if ((input->u.mi.dwFlags & (MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_RIGHTDOWN)) && hwnd == GetForegroundWindow()) - clip_fullscreen_window( hwnd ); + clip_fullscreen_window( hwnd, FALSE ); } /* update the wine server Z-order */ @@ -1280,7 +1283,11 @@ BOOL CDECL X11DRV_ClipCursor( LPCRECT clip ) else /* if currently clipping, check if we should switch to fullscreen clipping */ { struct x11drv_thread_data *data = x11drv_thread_data(); - if (data && data->clip_hwnd && clip_fullscreen_window( foreground )) return TRUE; + if (data && data->clip_hwnd) + { + if (EqualRect( clip, &clip_rect ) || clip_fullscreen_window( foreground, TRUE )) + return TRUE; + } } } ungrab_clipping_window(); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index fc6902b..ca7a379 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -846,7 +846,7 @@ extern void sync_window_cursor( Window window ); extern LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd ); extern void ungrab_clipping_window(void); extern void reset_clipping_window(void); -extern BOOL clip_fullscreen_window( HWND hwnd ); +extern BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ); extern void X11DRV_InitKeyboard( Display *display ); extern DWORD CDECL X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, DWORD mask, DWORD flags );
1
0
0
0
Marcus Meissner : winedump: Fixed minidump processor revision decoding ( Coverity).
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: 16d13f24a0c7d1afd46e898c1f74ab6cf5bd2099 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=16d13f24a0c7d1afd46e898c1…
Author: Marcus Meissner <meissner(a)suse.de> Date: Thu May 5 15:27:06 2011 +0200 winedump: Fixed minidump processor revision decoding (Coverity). --- programs/winedbg/tgt_minidump.c | 14 +++++++------- tools/winedump/minidump.c | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/programs/winedbg/tgt_minidump.c b/programs/winedbg/tgt_minidump.c index 142d5ca..f5750e8 100644 --- a/programs/winedbg/tgt_minidump.c +++ b/programs/winedbg/tgt_minidump.c @@ -238,18 +238,18 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) strcat(tmp, str); if (msi->ProcessorLevel == 3 || msi->ProcessorLevel == 4) { - if (HIWORD(msi->ProcessorRevision) == 0xFF) + if (HIBYTE(msi->ProcessorRevision) == 0xFF) sprintf(tmp + strlen(tmp), " (%c%d)", - 'A' + HIBYTE(LOWORD(msi->ProcessorRevision)), - LOBYTE(LOWORD(msi->ProcessorRevision))); + 'A' + ((msi->ProcessorRevision>>4)&0xf)-0x0a, + ((msi->ProcessorRevision&0xf))); else sprintf(tmp + strlen(tmp), " (%c%d)", - 'A' + HIWORD(msi->ProcessorRevision), - LOWORD(msi->ProcessorRevision)); + 'A' + HIBYTE(msi->ProcessorRevision), + LOBYTE(msi->ProcessorRevision)); } else sprintf(tmp + strlen(tmp), " (%d.%d)", - HIWORD(msi->ProcessorRevision), - LOWORD(msi->ProcessorRevision)); + HIBYTE(msi->ProcessorRevision), + LOBYTE(msi->ProcessorRevision)); str = tmp; break; case PROCESSOR_ARCHITECTURE_MIPS: diff --git a/tools/winedump/minidump.c b/tools/winedump/minidump.c index d860768..4cd04f3 100644 --- a/tools/winedump/minidump.c +++ b/tools/winedump/minidump.c @@ -267,12 +267,12 @@ void mdmp_dump(void) strcat(tmp, " ("); if (msi->ProcessorLevel == 3 || msi->ProcessorLevel == 4) { - if (HIWORD(msi->ProcessorRevision) == 0xFF) - sprintf(tmp + strlen(tmp), "%c%d", 'A' + HIBYTE(LOWORD(msi->ProcessorRevision)), LOBYTE(LOWORD(msi->ProcessorRevision))); + if (HIBYTE(msi->ProcessorRevision) == 0xFF) + sprintf(tmp + strlen(tmp), "%c%d", 'A' + ((msi->ProcessorRevision>>4)&0xf)-0x0a, msi->ProcessorRevision&0xf); else - sprintf(tmp + strlen(tmp), "%c%d", 'A' + HIWORD(msi->ProcessorRevision), LOWORD(msi->ProcessorRevision)); + sprintf(tmp + strlen(tmp), "%c%d", 'A' + HIBYTE(msi->ProcessorRevision), LOBYTE(msi->ProcessorRevision)); } - else sprintf(tmp + strlen(tmp), "%d.%d", HIWORD(msi->ProcessorRevision), LOWORD(msi->ProcessorRevision)); + else sprintf(tmp + strlen(tmp), "%d.%d", HIBYTE(msi->ProcessorRevision), LOBYTE(msi->ProcessorRevision)); str = tmp; break; case PROCESSOR_ARCHITECTURE_MIPS:
1
0
0
0
Damjan Jovanovic : mmsystem.dll16: Use flags instead of device type as the MCI_STATUS heuristic.
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: 15a3bd9c79bf8bf7db9acbf8032a91c36ba4fe67 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=15a3bd9c79bf8bf7db9acbf80…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Wed May 11 22:07:24 2011 +0200 mmsystem.dll16: Use flags instead of device type as the MCI_STATUS heuristic. --- dlls/mmsystem.dll16/mci16.c | 23 ++++++----------------- 1 files changed, 6 insertions(+), 17 deletions(-) diff --git a/dlls/mmsystem.dll16/mci16.c b/dlls/mmsystem.dll16/mci16.c index 27ae01d..3d9c73f 100644 --- a/dlls/mmsystem.dll16/mci16.c +++ b/dlls/mmsystem.dll16/mci16.c @@ -128,21 +128,10 @@ static LPWSTR MCI_strdupAtoW( LPCSTR str ) return ret; } -static DWORD MCI_get_device_type(UINT16 deviceId) -{ - MCI_GETDEVCAPS_PARMS parms; - MCIERROR err; - - err = mciSendCommandW(deviceId, MCI_GETDEVCAPS, MCI_GETDEVCAPS_DEVICE_TYPE | MCI_WAIT, (DWORD_PTR)&parms); - if (err != MMSYSERR_NOERROR) - return MCI_DEVTYPE_OTHER; - return parms.dwReturn; -} - /************************************************************************** * MCI_MapMsg16To32W [internal] */ -static MMSYSTEM_MapType MCI_MapMsg16To32W(UINT16 wDevID, WORD wMsg, DWORD dwFlags, DWORD_PTR* lParam) +static MMSYSTEM_MapType MCI_MapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR* lParam) { if (*lParam == 0) return MMSYSTEM_MAP_OK; @@ -204,7 +193,7 @@ static MMSYSTEM_MapType MCI_MapMsg16To32W(UINT16 wDevID, WORD wMsg, DWORD dwFlag return MMSYSTEM_MAP_OKMEM; case MCI_STATUS: { - if (MCI_get_device_type(wDevID) == MCI_DEVTYPE_DIGITAL_VIDEO) { + if (dwFlags & (MCI_DGV_STATUS_REFERENCE | MCI_DGV_STATUS_DISKSPACE)) { LPMCI_DGV_STATUS_PARMSW mdsp32w = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LPMCI_DGV_STATUS_PARMS16) + sizeof(MCI_DGV_STATUS_PARMSW)); LPMCI_DGV_STATUS_PARMS16 mdsp16 = MapSL(*lParam); @@ -394,7 +383,7 @@ static MMSYSTEM_MapType MCI_MapMsg16To32W(UINT16 wDevID, WORD wMsg, DWORD dwFlag /************************************************************************** * MCI_UnMapMsg16To32W [internal] */ -static MMSYSTEM_MapType MCI_UnMapMsg16To32W(UINT16 wDevID, WORD wMsg, DWORD dwFlags, DWORD_PTR lParam) +static MMSYSTEM_MapType MCI_UnMapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR lParam) { switch (wMsg) { /* case MCI_CAPTURE */ @@ -443,7 +432,7 @@ static MMSYSTEM_MapType MCI_UnMapMsg16To32W(UINT16 wDevID, WORD wMsg, DWORD dwF } return MMSYSTEM_MAP_OK; case MCI_STATUS: - if (lParam && MCI_get_device_type(wDevID) == MCI_DEVTYPE_DIGITAL_VIDEO) { + if (lParam && (dwFlags & (MCI_DGV_STATUS_REFERENCE | MCI_DGV_STATUS_DISKSPACE))) { LPMCI_DGV_STATUS_PARMSW mdsp32w = (LPMCI_DGV_STATUS_PARMSW)lParam; char *base = (char*)lParam - sizeof(LPMCI_DGV_STATUS_PARMS16); LPMCI_DGV_STATUS_PARMS16 mdsp16 = *(LPMCI_DGV_STATUS_PARMS16*)base; @@ -759,7 +748,7 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD dwRet = MCIERR_INVALID_DEVICE_ID; - switch (res = MCI_MapMsg16To32W(wDevID, wMsg, dwParam1, &dwParam2)) { + switch (res = MCI_MapMsg16To32W(wMsg, dwParam1, &dwParam2)) { case MMSYSTEM_MAP_MSGERROR: TRACE("%s not handled yet\n", MCI_MessageToString(wMsg)); dwRet = MCIERR_DRIVER_INTERNAL; @@ -772,7 +761,7 @@ DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD case MMSYSTEM_MAP_OKMEM: dwRet = mciSendCommandW(wDevID, wMsg, dwParam1, dwParam2); if (res == MMSYSTEM_MAP_OKMEM) - MCI_UnMapMsg16To32W(wDevID, wMsg, dwParam1, dwParam2); + MCI_UnMapMsg16To32W(wMsg, dwParam1, dwParam2); break; } }
1
0
0
0
Huw Davies : gdi32/tests: Add tests for 32 bpp DIB pattern brush fills.
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: 8a43f3535c7d7325e0436846c2f854c4523ed84d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8a43f3535c7d7325e0436846c…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 12 13:01:26 2011 +0100 gdi32/tests: Add tests for 32 bpp DIB pattern brush fills. --- dlls/gdi32/tests/dib.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 67 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/tests/dib.c b/dlls/gdi32/tests/dib.c index 196cbc5..4a9c692 100644 --- a/dlls/gdi32/tests/dib.c +++ b/dlls/gdi32/tests/dib.c @@ -90,6 +90,8 @@ static const char *sha1_graphics_a8r8g8b8[] = "6c530622a025d872a642e8f950867884d7b136cb", "7c07d91b8f68fb31821701b3dcb96de018bf0c66", "b2261353decda2712b83538ab434a49ce21f3172", + "a8b59f25984b066fc6b91cae6bf983a78028ba7f", + "3d95adb85b9673a932ac847a4b5451fa59885f74", NULL }; @@ -240,19 +242,25 @@ static const RECT patblt_clips[] = {170, 200, 176, 210}, /* t edge on b edgecase clipped */ }; +static const BITMAPINFOHEADER dib_brush_header_32 = {sizeof(BITMAPINFOHEADER), 16, -16, 1, 32, BI_RGB, 0, 0, 0, 0, 0}; + static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const char ***sha1) { DWORD dib_size = get_dib_size(bmi); HPEN solid_pen, dashed_pen, orig_pen; - HBRUSH solid_brush, orig_brush; + HBRUSH solid_brush, dib_brush, orig_brush; INT i, y; HRGN hrgn, hrgn2; + BYTE dib_brush_buf[sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD) + 16 * 16 * sizeof(DWORD)]; /* Enough for 16 x 16 at 32 bpp */ + BITMAPINFO *brush_bi = (BITMAPINFO*)dib_brush_buf; + BYTE *brush_bits; memset(bits, 0xcc, dib_size); compare_hash(bmi, bits, sha1, "empty"); solid_pen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0xff)); orig_pen = SelectObject(hdc, solid_pen); + SetBrushOrgEx(hdc, 0, 0, NULL); /* horizontal and vertical lines */ for(i = 1; i <= 16; i++) @@ -415,8 +423,66 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const char ***sh ExtSelectClipRgn(hdc, NULL, RGN_COPY); + /* DIB pattern brush */ + + brush_bi->bmiHeader = dib_brush_header_32; + brush_bits = (BYTE*)brush_bi + sizeof(BITMAPINFOHEADER); + memset(brush_bits, 0, 16 * 16 * sizeof(DWORD)); + brush_bits[2] = 0xff; + brush_bits[6] = 0xff; + brush_bits[65] = 0xff; + brush_bits[69] = 0xff; + + dib_brush = CreateDIBPatternBrushPt(brush_bi, DIB_RGB_COLORS); + + SelectObject(hdc, dib_brush); + SetBrushOrgEx(hdc, 1, 1, NULL); + + for(i = 0, y = 10; i < 256; i++) + { + BOOL ret; + + if(!rop_uses_src(rop3[i])) + { + ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); + ok(ret, "got FALSE for %x\n", rop3[i]); + y += 25; + } + } + compare_hash(bmi, bits, sha1, "top-down dib brush patblt"); + memset(bits, 0xcc, dib_size); + + SelectObject(hdc, orig_brush); + DeleteObject(dib_brush); + + /* Bottom-up DIB pattern brush */ + + brush_bi->bmiHeader.biHeight = -brush_bi->bmiHeader.biHeight; + + dib_brush = CreateDIBPatternBrushPt(brush_bi, DIB_RGB_COLORS); + + SelectObject(hdc, dib_brush); + SetBrushOrgEx(hdc, 100, 100, NULL); + + for(i = 0, y = 10; i < 256; i++) + { + BOOL ret; + + if(!rop_uses_src(rop3[i])) + { + ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]); + ok(ret, "got FALSE for %x\n", rop3[i]); + y += 25; + } + } + compare_hash(bmi, bits, sha1, "bottom-up dib brush patblt"); + memset(bits, 0xcc, dib_size); + + SetBrushOrgEx(hdc, 0, 0, NULL); + SelectObject(hdc, orig_brush); SelectObject(hdc, orig_pen); + DeleteObject(dib_brush); DeleteObject(dashed_pen); DeleteObject(solid_brush); DeleteObject(solid_pen);
1
0
0
0
Huw Davies : gdi32: Add support for DIB pattern brush fills.
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: 5b28336c26e02692e6553bb62ba405553da39a31 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b28336c26e02692e6553bb62…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 12 12:46:50 2011 +0100 gdi32: Add support for DIB pattern brush fills. --- dlls/gdi32/dibdrv/dibdrv.h | 1 + dlls/gdi32/dibdrv/objects.c | 101 +++++++++++++++++++++++++++++++++++---- dlls/gdi32/dibdrv/primitives.c | 79 +++++++++++++++++++++++++++++++ 3 files changed, 170 insertions(+), 11 deletions(-) diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h index 1982866..a502c72 100644 --- a/dlls/gdi32/dibdrv/dibdrv.h +++ b/dlls/gdi32/dibdrv/dibdrv.h @@ -38,6 +38,7 @@ static inline DC *get_dibdrv_dc( PHYSDEV dev ) typedef struct primitive_funcs { void (* solid_rects)(const dib_info *dib, int num, const RECT *rc, DWORD and, DWORD xor); + void (* pattern_rects)(const dib_info *dib, int num, const RECT *rc, const POINT *orign, const dib_info *brush, void *and_bits, void *xor_bits); DWORD (* colorref_to_pixel)(const dib_info *dib, COLORREF color); } primitive_funcs; diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index dde7a96..795bd5e 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <assert.h> #include <stdlib.h> #include "gdi_private.h" @@ -956,17 +957,6 @@ static BOOL solid_brush(dibdrv_physdev *pdev, int num, RECT *rects) return TRUE; } -/********************************************************************** - * pattern_brush - * - * Fill a number of rectangles with the pattern brush - * FIXME: Should we insist l < r && t < b? Currently we assume this. - */ -static BOOL pattern_brush(dibdrv_physdev *pdev, int num, RECT *rects) -{ - return FALSE; -} - static void free_pattern_brush_bits( dibdrv_physdev *pdev ) { HeapFree(GetProcessHeap(), 0, pdev->brush_and_bits); @@ -981,6 +971,95 @@ void free_pattern_brush( dibdrv_physdev *pdev ) free_dib_info( &pdev->brush_dib, TRUE ); } +static BOOL create_pattern_brush_bits(dibdrv_physdev *pdev) +{ + DWORD size = pdev->brush_dib.height * abs(pdev->brush_dib.stride); + DWORD *brush_bits = pdev->brush_dib.bits; + DWORD *and_bits, *xor_bits; + + assert(pdev->brush_and_bits == NULL); + assert(pdev->brush_xor_bits == NULL); + + and_bits = pdev->brush_and_bits = HeapAlloc(GetProcessHeap(), 0, size); + xor_bits = pdev->brush_xor_bits = HeapAlloc(GetProcessHeap(), 0, size); + + if(!and_bits || !xor_bits) + { + ERR("Failed to create pattern brush bits\n"); + free_pattern_brush_bits( pdev ); + return FALSE; + } + + if(pdev->brush_dib.stride < 0) + brush_bits = (DWORD*)((BYTE*)brush_bits + (pdev->brush_dib.height - 1) * pdev->brush_dib.stride); + + while(size) + { + calc_and_xor_masks(pdev->brush_rop, *brush_bits++, and_bits++, xor_bits++); + size -= 4; + } + + if(pdev->brush_dib.stride < 0) + { + /* Update the bits ptrs if the dib is bottom up. The subtraction is because stride is -ve */ + pdev->brush_and_bits = (BYTE*)pdev->brush_and_bits - (pdev->brush_dib.height - 1) * pdev->brush_dib.stride; + pdev->brush_xor_bits = (BYTE*)pdev->brush_xor_bits - (pdev->brush_dib.height - 1) * pdev->brush_dib.stride; + } + + return TRUE; +} + +/********************************************************************** + * pattern_brush + * + * Fill a number of rectangles with the pattern brush + * FIXME: Should we insist l < r && t < b? Currently we assume this. + */ +static BOOL pattern_brush(dibdrv_physdev *pdev, int num, RECT *rects) +{ + int i, j; + const WINEREGION *clip; + POINT origin; + + if(pdev->brush_and_bits == NULL) + if(!create_pattern_brush_bits(pdev)) + return FALSE; + + GetBrushOrgEx(pdev->dev.hdc, &origin); + + clip = get_wine_region(pdev->clip); + for(i = 0; i < num; i++) + { + for(j = 0; j < clip->numRects; j++) + { + RECT rect = rects[i]; + + /* Optimize unclipped case */ + if(clip->rects[j].top <= rect.top && clip->rects[j].bottom >= rect.bottom && + clip->rects[j].left <= rect.left && clip->rects[j].right >= rect.right) + { + pdev->dib.funcs->pattern_rects(&pdev->dib, 1, &rect, &origin, &pdev->brush_dib, pdev->brush_and_bits, pdev->brush_xor_bits); + break; + } + + if(clip->rects[j].top >= rect.bottom) break; + if(clip->rects[j].bottom <= rect.top) continue; + + if(clip->rects[j].right > rect.left && clip->rects[j].left < rect.right) + { + rect.left = max(rect.left, clip->rects[j].left); + rect.top = max(rect.top, clip->rects[j].top); + rect.right = min(rect.right, clip->rects[j].right); + rect.bottom = min(rect.bottom, clip->rects[j].bottom); + + pdev->dib.funcs->pattern_rects(&pdev->dib, 1, &rect, &origin, &pdev->brush_dib, pdev->brush_and_bits, pdev->brush_xor_bits); + } + } + } + release_wine_region(pdev->clip); + return TRUE; +} + void update_brush_rop( dibdrv_physdev *pdev, INT rop ) { pdev->brush_rop = rop; diff --git a/dlls/gdi32/dibdrv/primitives.c b/dlls/gdi32/dibdrv/primitives.c index a35877e..6dec478 100644 --- a/dlls/gdi32/dibdrv/primitives.c +++ b/dlls/gdi32/dibdrv/primitives.c @@ -50,6 +50,82 @@ static void solid_rects_null(const dib_info *dib, int num, const RECT *rc, DWORD return; } +static inline INT calc_offset(INT edge, INT size, INT origin) +{ + INT offset; + + if(edge - origin >= 0) + offset = (edge - origin) % size; + else + { + offset = (origin - edge) % size; + if(offset) offset = size - offset; + } + return offset; +} + +static inline POINT calc_brush_offset(const RECT *rc, const dib_info *brush, const POINT *origin) +{ + POINT offset; + + offset.x = calc_offset(rc->left, brush->width, origin->x); + offset.y = calc_offset(rc->top, brush->height, origin->y); + + return offset; +} + +static void pattern_rects_32(const dib_info *dib, int num, const RECT *rc, const POINT *origin, + const dib_info *brush, void *and_bits, void *xor_bits) +{ + DWORD *ptr, *start, *start_and, *and_ptr, *start_xor, *xor_ptr; + int x, y, i; + POINT offset; + + for(i = 0; i < num; i++, rc++) + { + offset = calc_brush_offset(rc, brush, origin); + + start = get_pixel_ptr_32(dib, rc->left, rc->top); + start_and = (DWORD*)and_bits + offset.y * brush->stride / 4; + start_xor = (DWORD*)xor_bits + offset.y * brush->stride / 4; + + for(y = rc->top; y < rc->bottom; y++, start += dib->stride / 4) + { + and_ptr = start_and + offset.x; + xor_ptr = start_xor + offset.x; + + for(x = rc->left, ptr = start; x < rc->right; x++) + { + do_rop_32(ptr++, *and_ptr++, *xor_ptr++); + if(and_ptr == start_and + brush->width) + { + and_ptr = start_and; + xor_ptr = start_xor; + } + } + + offset.y++; + if(offset.y == brush->height) + { + start_and = and_bits; + start_xor = xor_bits; + offset.y = 0; + } + else + { + start_and += brush->stride / 4; + start_xor += brush->stride / 4; + } + } + } +} + +static void pattern_rects_null(const dib_info *dib, int num, const RECT *rc, const POINT *origin, + const dib_info *brush, void *and_bits, void *xor_bits) +{ + return; +} + static DWORD colorref_to_pixel_888(const dib_info *dib, COLORREF color) { return ( ((color >> 16) & 0xff) | (color & 0xff00) | ((color << 16) & 0xff0000) ); @@ -88,17 +164,20 @@ static DWORD colorref_to_pixel_null(const dib_info *dib, COLORREF color) const primitive_funcs funcs_8888 = { solid_rects_32, + pattern_rects_32, colorref_to_pixel_888 }; const primitive_funcs funcs_32 = { solid_rects_32, + pattern_rects_32, colorref_to_pixel_masks }; const primitive_funcs funcs_null = { solid_rects_null, + pattern_rects_null, colorref_to_pixel_null };
1
0
0
0
Huw Davies : gdi32: Implement SelectBrush for DIB pattern brushes.
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: 3c70a26e4b8b2814b44ef6e284a750a369404a3a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3c70a26e4b8b2814b44ef6e28…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 12 12:05:37 2011 +0100 gdi32: Implement SelectBrush for DIB pattern brushes. --- dlls/gdi32/dibdrv/dc.c | 102 ++++++++++++++++++++++++++++++++++++++++++- dlls/gdi32/dibdrv/dibdrv.h | 5 ++ dlls/gdi32/dibdrv/objects.c | 49 ++++++++++++++++++++ dlls/gdi32/gdi_private.h | 2 + 4 files changed, 157 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index a9a53ad..7a11bec 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -108,6 +108,29 @@ static BOOL init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD return TRUE; } +BOOL init_dib_info_from_packed(dib_info *dib, const BITMAPINFOHEADER *bi, WORD usage) +{ + DWORD *masks = NULL; + RGBQUAD *color_table = NULL; + BYTE *ptr = (BYTE*)bi + bi->biSize; + int num_colors = bi->biClrUsed; + + if(bi->biCompression == BI_BITFIELDS) + { + masks = (DWORD *)ptr; + ptr += 3 * sizeof(DWORD); + } + + if(!num_colors && bi->biBitCount <= 8) num_colors = 1 << bi->biBitCount; + if(num_colors) color_table = (RGBQUAD*)ptr; + if(usage == DIB_PAL_COLORS) + ptr += num_colors * sizeof(WORD); + else + ptr += num_colors * sizeof(*color_table); + + return init_dib_info(dib, bi, masks, ptr); +} + static void clear_dib_info(dib_info *dib) { dib->bits = NULL; @@ -118,7 +141,7 @@ static void clear_dib_info(dib_info *dib) * * Free the resources associated with a dib and optionally the bits */ -static void free_dib_info(dib_info *dib, BOOL free_bits) +void free_dib_info(dib_info *dib, BOOL free_bits) { if(free_bits) { @@ -127,6 +150,80 @@ static void free_dib_info(dib_info *dib, BOOL free_bits) } } +void copy_dib_color_info(dib_info *dst, const dib_info *src) +{ + dst->bit_count = src->bit_count; + dst->red_mask = src->red_mask; + dst->green_mask = src->green_mask; + dst->blue_mask = src->blue_mask; + dst->red_len = src->red_len; + dst->green_len = src->green_len; + dst->blue_len = src->blue_len; + dst->red_shift = src->red_shift; + dst->green_shift = src->green_shift; + dst->blue_shift = src->blue_shift; + dst->funcs = src->funcs; +} + +static BOOL dib_formats_match(const dib_info *d1, const dib_info *d2) +{ + if(d1->bit_count != d2->bit_count) return FALSE; + + switch(d1->bit_count) + { + case 24: return TRUE; + + case 32: + case 16: + return (d1->red_mask == d2->red_mask) && (d1->green_mask == d2->green_mask) && + (d1->blue_mask == d2->blue_mask); + + default: + ERR("Unexpected depth %d\n", d1->bit_count); + return FALSE; + } +} + +/************************************************************** + * convert_dib + * + * Converts src into the format specified in dst. + * + * FIXME: At the moment this always creates a top-down dib, + * do we want to give the option of bottom-up? + */ +BOOL convert_dib(dib_info *dst, const dib_info *src) +{ + INT y; + + dst->height = src->height; + dst->width = src->width; + dst->stride = ((dst->width * dst->bit_count + 31) >> 3) & ~3; + dst->bits = NULL; + + if(dib_formats_match(src, dst)) + { + dst->bits = HeapAlloc(GetProcessHeap(), 0, dst->height * dst->stride); + + if(src->stride > 0) + memcpy(dst->bits, src->bits, dst->height * dst->stride); + else + { + BYTE *src_bits = src->bits; + BYTE *dst_bits = dst->bits; + for(y = 0; y < dst->height; y++) + { + memcpy(dst_bits, src_bits, dst->stride); + dst_bits += dst->stride; + src_bits += src->stride; + } + } + return TRUE; + } + FIXME("Format conversion not implemented\n"); + return FALSE; +} + /*********************************************************************** * dibdrv_DeleteDC */ @@ -135,6 +232,7 @@ static BOOL CDECL dibdrv_DeleteDC( PHYSDEV dev ) dibdrv_physdev *pdev = get_dibdrv_pdev(dev); TRACE("(%p)\n", dev); DeleteObject(pdev->clip); + free_pattern_brush(pdev); free_dib_info(&pdev->dib, FALSE); return 0; } @@ -156,6 +254,8 @@ static HBITMAP CDECL dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap ) pdev->defer = 0; clear_dib_info(&pdev->dib); + clear_dib_info(&pdev->brush_dib); + pdev->brush_and_bits = pdev->brush_xor_bits = NULL; if(!init_dib_info(&pdev->dib, &bmp->dib->dsBmih, bmp->dib->dsBitfields, bmp->dib->dsBm.bmBits)) pdev->defer |= DEFER_FORMAT; diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h index 7327fca..1982866 100644 --- a/dlls/gdi32/dibdrv/dibdrv.h +++ b/dlls/gdi32/dibdrv/dibdrv.h @@ -48,6 +48,11 @@ extern const primitive_funcs funcs_null DECLSPEC_HIDDEN; extern void calc_and_xor_masks(INT rop, DWORD color, DWORD *and, DWORD *xor) DECLSPEC_HIDDEN; extern void update_brush_rop( dibdrv_physdev *pdev, INT rop ) DECLSPEC_HIDDEN; extern void reset_dash_origin(dibdrv_physdev *pdev) DECLSPEC_HIDDEN; +extern BOOL init_dib_info_from_packed(dib_info *dib, const BITMAPINFOHEADER *bi, WORD usage) DECLSPEC_HIDDEN; +extern void free_dib_info(dib_info *dib, BOOL free_bits) DECLSPEC_HIDDEN; +extern void free_pattern_brush(dibdrv_physdev *pdev) DECLSPEC_HIDDEN; +extern void copy_dib_color_info(dib_info *dst, const dib_info *src) DECLSPEC_HIDDEN; +extern BOOL convert_dib(dib_info *dst, const dib_info *src) DECLSPEC_HIDDEN; static inline BOOL defer_pen(dibdrv_physdev *pdev) { diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index 52aab44..dde7a96 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -956,11 +956,37 @@ static BOOL solid_brush(dibdrv_physdev *pdev, int num, RECT *rects) return TRUE; } +/********************************************************************** + * pattern_brush + * + * Fill a number of rectangles with the pattern brush + * FIXME: Should we insist l < r && t < b? Currently we assume this. + */ +static BOOL pattern_brush(dibdrv_physdev *pdev, int num, RECT *rects) +{ + return FALSE; +} + +static void free_pattern_brush_bits( dibdrv_physdev *pdev ) +{ + HeapFree(GetProcessHeap(), 0, pdev->brush_and_bits); + HeapFree(GetProcessHeap(), 0, pdev->brush_xor_bits); + pdev->brush_and_bits = NULL; + pdev->brush_xor_bits = NULL; +} + +void free_pattern_brush( dibdrv_physdev *pdev ) +{ + free_pattern_brush_bits( pdev ); + free_dib_info( &pdev->brush_dib, TRUE ); +} + void update_brush_rop( dibdrv_physdev *pdev, INT rop ) { pdev->brush_rop = rop; if(pdev->brush_style == BS_SOLID) calc_and_xor_masks(rop, pdev->brush_color, &pdev->brush_and, &pdev->brush_xor); + free_pattern_brush_bits( pdev ); } /*********************************************************************** @@ -983,6 +1009,8 @@ HBRUSH CDECL dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush ) pdev->defer |= DEFER_BRUSH; + free_pattern_brush( pdev ); + switch(logbrush.lbStyle) { case BS_SOLID: @@ -991,6 +1019,27 @@ HBRUSH CDECL dibdrv_SelectBrush( PHYSDEV dev, HBRUSH hbrush ) pdev->brush_rects = solid_brush; pdev->defer &= ~DEFER_BRUSH; break; + + case BS_DIBPATTERN: + { + BITMAPINFOHEADER *bi = GlobalLock((HGLOBAL)logbrush.lbHatch); + dib_info orig_dib; + + if(!bi) return NULL; + if(init_dib_info_from_packed(&orig_dib, bi, LOWORD(logbrush.lbColor))) + { + copy_dib_color_info(&pdev->brush_dib, &pdev->dib); + if(convert_dib(&pdev->brush_dib, &orig_dib)) + { + pdev->brush_rects = pattern_brush; + pdev->defer &= ~DEFER_BRUSH; + } + free_dib_info(&orig_dib, FALSE); + } + GlobalUnlock((HGLOBAL)logbrush.lbHatch); + break; + } + default: break; } diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 9cb528c..0f59f48 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -124,6 +124,8 @@ typedef struct dibdrv_physdev UINT brush_style; INT brush_rop; /* PatBlt, for example, can override the DC's rop2 */ DWORD brush_color, brush_and, brush_xor; + dib_info brush_dib; + void *brush_and_bits, *brush_xor_bits; BOOL (* brush_rects)(struct dibdrv_physdev *pdev, int num, RECT *rects); /* background */
1
0
0
0
Huw Davies : gdi32: Add helpers to clear and free dib_info structures.
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: 5ac51cd24f386d5bb7136f09e1448ffb5cc1b943 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5ac51cd24f386d5bb7136f09e…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 12 11:27:35 2011 +0100 gdi32: Add helpers to clear and free dib_info structures. --- dlls/gdi32/dibdrv/dc.c | 48 +++++++++++++++++++++++++++++++++++------------- 1 files changed, 35 insertions(+), 13 deletions(-) diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index e43ec15..a9a53ad 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -27,17 +27,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dib); -/*********************************************************************** - * dibdrv_DeleteDC - */ -static BOOL CDECL dibdrv_DeleteDC( PHYSDEV dev ) -{ - dibdrv_physdev *pdev = get_dibdrv_pdev(dev); - TRACE("(%p)\n", dev); - DeleteObject(pdev->clip); - return 0; -} - static void calc_shift_and_len(DWORD mask, int *shift, int *len) { int s, l; @@ -74,7 +63,7 @@ static void init_bit_fields(dib_info *dib, const DWORD *bit_fields) calc_shift_and_len(dib->blue_mask, &dib->blue_shift, &dib->blue_len); } -static BOOL init_dib(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_fields, void *bits) +static BOOL init_dib_info(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit_fields, void *bits) { static const DWORD bit_fields_888[3] = {0xff0000, 0x00ff00, 0x0000ff}; @@ -119,6 +108,37 @@ static BOOL init_dib(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit return TRUE; } +static void clear_dib_info(dib_info *dib) +{ + dib->bits = NULL; +} + +/********************************************************************** + * free_dib_info + * + * Free the resources associated with a dib and optionally the bits + */ +static void free_dib_info(dib_info *dib, BOOL free_bits) +{ + if(free_bits) + { + HeapFree(GetProcessHeap(), 0, dib->bits); + dib->bits = NULL; + } +} + +/*********************************************************************** + * dibdrv_DeleteDC + */ +static BOOL CDECL dibdrv_DeleteDC( PHYSDEV dev ) +{ + dibdrv_physdev *pdev = get_dibdrv_pdev(dev); + TRACE("(%p)\n", dev); + DeleteObject(pdev->clip); + free_dib_info(&pdev->dib, FALSE); + return 0; +} + /*********************************************************************** * dibdrv_SelectBitmap */ @@ -135,7 +155,9 @@ static HBITMAP CDECL dibdrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap ) pdev->clip = CreateRectRgn(0, 0, 0, 0); pdev->defer = 0; - if(!init_dib(&pdev->dib, &bmp->dib->dsBmih, bmp->dib->dsBitfields, bmp->dib->dsBm.bmBits)) + clear_dib_info(&pdev->dib); + + if(!init_dib_info(&pdev->dib, &bmp->dib->dsBmih, bmp->dib->dsBitfields, bmp->dib->dsBm.bmBits)) pdev->defer |= DEFER_FORMAT; GDI_ReleaseObj( bitmap );
1
0
0
0
Huw Davies : gdi32: Keep track of changes to the brush rop, so that we can perform lazy realisation of the brush.
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: 735657d1b87db431c301bb5def1c30121389ec8e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=735657d1b87db431c301bb5de…
Author: Huw Davies <huw(a)codeweavers.com> Date: Thu May 12 10:22:28 2011 +0100 gdi32: Keep track of changes to the brush rop, so that we can perform lazy realisation of the brush. --- dlls/gdi32/dibdrv/objects.c | 1 + dlls/gdi32/gdi_private.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c index a0e238e..52aab44 100644 --- a/dlls/gdi32/dibdrv/objects.c +++ b/dlls/gdi32/dibdrv/objects.c @@ -958,6 +958,7 @@ static BOOL solid_brush(dibdrv_physdev *pdev, int num, RECT *rects) void update_brush_rop( dibdrv_physdev *pdev, INT rop ) { + pdev->brush_rop = rop; if(pdev->brush_style == BS_SOLID) calc_and_xor_masks(rop, pdev->brush_color, &pdev->brush_and, &pdev->brush_xor); } diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 7b4c585..9cb528c 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -122,6 +122,7 @@ typedef struct dibdrv_physdev /* brush */ UINT brush_style; + INT brush_rop; /* PatBlt, for example, can override the DC's rop2 */ DWORD brush_color, brush_and, brush_xor; BOOL (* brush_rects)(struct dibdrv_physdev *pdev, int num, RECT *rects);
1
0
0
0
Jacek Caban : kernel32: Moved GetModuleInformation implementation to kernel32.
by Alexandre Julliard
12 May '11
12 May '11
Module: wine Branch: master Commit: 0d0f2fa4a95050292d7c7ed92b477c03231925b1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0d0f2fa4a95050292d7c7ed92…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu May 12 12:23:45 2011 +0000 kernel32: Moved GetModuleInformation implementation to kernel32. --- dlls/kernel32/kernel32.spec | 1 + dlls/kernel32/module.c | 24 ++++++++ dlls/psapi/psapi.spec | 2 +- dlls/psapi/psapi_main.c | 136 ------------------------------------------- 4 files changed, 26 insertions(+), 137 deletions(-) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 3f85557..31680fe 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -776,6 +776,7 @@ @ stdcall K32GetModuleBaseNameW(long long ptr long) @ stdcall K32GetModuleFileNameExA(long long ptr long) @ stdcall K32GetModuleFileNameExW(long long ptr long) +@ stdcall K32GetModuleInformation(long long ptr long) @ stdcall K32GetProcessMemoryInfo(long ptr long) @ stdcall K32QueryWorkingSet(long ptr long) @ stdcall K32QueryWorkingSetEx(long ptr long) diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c index 94d20c3..8ee0fcd 100644 --- a/dlls/kernel32/module.c +++ b/dlls/kernel32/module.c @@ -37,6 +37,7 @@ #include "winbase.h" #include "winternl.h" #include "kernel_private.h" +#include "psapi.h" #include "wine/exception.h" #include "wine/debug.h" @@ -1283,6 +1284,29 @@ DWORD WINAPI K32GetModuleFileNameExA(HANDLE process, HMODULE module, return strlen(file_name); } +/*********************************************************************** + * K32GetModuleInformation (KERNEL32.@) + */ +BOOL WINAPI K32GetModuleInformation(HANDLE process, HMODULE module, + MODULEINFO *modinfo, DWORD cb) +{ + LDR_MODULE ldr_module; + + if (cb < sizeof(MODULEINFO)) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return FALSE; + } + + if (!get_ldr_module(process, module, &ldr_module)) + return FALSE; + + modinfo->lpBaseOfDll = ldr_module.BaseAddress; + modinfo->SizeOfImage = ldr_module.SizeOfImage; + modinfo->EntryPoint = ldr_module.EntryPoint; + return TRUE; +} + #ifdef __i386__ /*********************************************************************** diff --git a/dlls/psapi/psapi.spec b/dlls/psapi/psapi.spec index 0427891..aaf2931 100644 --- a/dlls/psapi/psapi.spec +++ b/dlls/psapi/psapi.spec @@ -14,7 +14,7 @@ @ stdcall GetModuleBaseNameW(long long ptr long) kernel32.K32GetModuleBaseNameW @ stdcall GetModuleFileNameExA(long long ptr long) kernel32.K32GetModuleFileNameExA @ stdcall GetModuleFileNameExW(long long ptr long) kernel32.K32GetModuleFileNameExW -@ stdcall GetModuleInformation(long long ptr long) +@ stdcall GetModuleInformation(long long ptr long) kernel32.K32GetModuleInformation @ stdcall GetPerformanceInfo(ptr long) @ stdcall GetProcessImageFileNameA(long ptr long) kernel32.K32GetProcessImageFileNameA @ stdcall GetProcessImageFileNameW(long ptr long) kernel32.K32GetProcessImageFileNameW diff --git a/dlls/psapi/psapi_main.c b/dlls/psapi/psapi_main.c index b4cabca..b297b7b 100644 --- a/dlls/psapi/psapi_main.c +++ b/dlls/psapi/psapi_main.c @@ -34,119 +34,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(psapi); -typedef struct -{ - HANDLE hProcess; - PLIST_ENTRY pHead, pCurrent; - LDR_MODULE LdrModule; -} MODULE_ITERATOR; - -/*********************************************************************** - * PSAPI_ModuleIteratorInit [internal] - * - * Prepares to iterate through the loaded modules of the given process. - * - * RETURNS - * Success: TRUE - * Failure: FALSE - */ -static BOOL PSAPI_ModuleIteratorInit(MODULE_ITERATOR *iter, HANDLE hProcess) -{ - PROCESS_BASIC_INFORMATION pbi; - PPEB_LDR_DATA pLdrData; - NTSTATUS status; - - /* Get address of PEB */ - status = NtQueryInformationProcess(hProcess, ProcessBasicInformation, - &pbi, sizeof(pbi), NULL); - if (status != STATUS_SUCCESS) - { - SetLastError(RtlNtStatusToDosError(status)); - return FALSE; - } - - /* Read address of LdrData from PEB */ - if (!ReadProcessMemory(hProcess, &pbi.PebBaseAddress->LdrData, - &pLdrData, sizeof(pLdrData), NULL)) - return FALSE; - - /* Read address of first module from LdrData */ - if (!ReadProcessMemory(hProcess, - &pLdrData->InLoadOrderModuleList.Flink, - &iter->pCurrent, sizeof(iter->pCurrent), NULL)) - return FALSE; - - iter->pHead = &pLdrData->InLoadOrderModuleList; - iter->hProcess = hProcess; - - return TRUE; -} - -/*********************************************************************** - * PSAPI_ModuleIteratorNext [internal] - * - * Iterates to the next module. - * - * RETURNS - * 1 : Success - * 0 : No more modules - * -1 : Failure - * - * NOTES - * Every function which uses this routine suffers from a race condition - * when a module is unloaded during the enumeration which can cause the - * function to fail. As there is no way to lock the loader of another - * process we can't avoid that. - */ -static INT PSAPI_ModuleIteratorNext(MODULE_ITERATOR *iter) -{ - if (iter->pCurrent == iter->pHead) - return 0; - - if (!ReadProcessMemory(iter->hProcess, CONTAINING_RECORD(iter->pCurrent, - LDR_MODULE, InLoadOrderModuleList), - &iter->LdrModule, sizeof(iter->LdrModule), NULL)) - return -1; - else - iter->pCurrent = iter->LdrModule.InLoadOrderModuleList.Flink; - - return 1; -} - -/*********************************************************************** - * PSAPI_GetLdrModule [internal] - * - * Reads the LDR_MODULE structure of the given module. - * - * RETURNS - * Success: TRUE - * Failure: FALSE - */ - -static BOOL PSAPI_GetLdrModule(HANDLE hProcess, HMODULE hModule, - LDR_MODULE *pLdrModule) -{ - MODULE_ITERATOR iter; - INT ret; - - if (!PSAPI_ModuleIteratorInit(&iter, hProcess)) - return FALSE; - - while ((ret = PSAPI_ModuleIteratorNext(&iter)) > 0) - /* When hModule is NULL we return the process image - which will be - * the first module since our iterator uses InLoadOrderModuleList */ - if (!hModule || hModule == iter.LdrModule.BaseAddress) - { - *pLdrModule = iter.LdrModule; - return TRUE; - } - - if (ret == 0) - SetLastError(ERROR_INVALID_HANDLE); - - return FALSE; -} - /*********************************************************************** * EnumDeviceDrivers (PSAPI.@) */ @@ -263,29 +150,6 @@ DWORD WINAPI GetMappedFileNameW(HANDLE hProcess, LPVOID lpv, LPWSTR lpFilename, } /*********************************************************************** - * GetModuleInformation (PSAPI.@) - */ -BOOL WINAPI GetModuleInformation(HANDLE hProcess, HMODULE hModule, - LPMODULEINFO lpmodinfo, DWORD cb) -{ - LDR_MODULE LdrModule; - - if (cb < sizeof(MODULEINFO)) - { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } - - if (!PSAPI_GetLdrModule(hProcess, hModule, &LdrModule)) - return FALSE; - - lpmodinfo->lpBaseOfDll = LdrModule.BaseAddress; - lpmodinfo->SizeOfImage = LdrModule.SizeOfImage; - lpmodinfo->EntryPoint = LdrModule.EntryPoint; - return TRUE; -} - -/*********************************************************************** * GetPerformanceInfo (PSAPI.@) */ BOOL WINAPI GetPerformanceInfo( PPERFORMANCE_INFORMATION info, DWORD size )
1
0
0
0
← Newer
1
...
58
59
60
61
62
63
64
...
95
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
Results per page:
10
25
50
100
200