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
October 2009
----- 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
1207 discussions
Start a n
N
ew thread
Nikolay Sivov : comctl32/monthcal: Explicitly set required control size.
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: 1ab851a1bd8a2aa17ec7b1545fc6ca6ad4e52e2a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ab851a1bd8a2aa17ec7b1545…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Sun Oct 18 15:33:36 2009 +0400 comctl32/monthcal: Explicitly set required control size. --- dlls/comctl32/tests/monthcal.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c index f59614c..de6df2d 100644 --- a/dlls/comctl32/tests/monthcal.c +++ b/dlls/comctl32/tests/monthcal.c @@ -1351,6 +1351,11 @@ static void test_monthcal_monthrange(void) /* to be locale independent */ SendMessage(hwnd, MCM_SETFIRSTDAYOFWEEK, 0, (LPARAM)6); + res = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); + expect(TRUE, res); + /* resize control to display two Calendars */ + MoveWindow(hwnd, 0, 0, r.right, (5/2)*r.bottom, FALSE); + flush_sequences(sequences, NUM_MSG_SEQUENCES); res = SendMessage(hwnd, MCM_GETMONTHRANGE, GMR_VISIBLE, (LPARAM)st_visible); @@ -1383,7 +1388,6 @@ static void test_monthcal_monthrange(void) ok_sequence(sequences, MONTHCAL_SEQ_INDEX, monthcal_monthrange_seq, "monthcal monthrange", FALSE); /* resize control to display single Calendar */ - res = SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); MoveWindow(hwnd, 0, 0, r.right, r.bottom, FALSE); memset(&st, 0, sizeof(st));
1
0
0
0
Nikolay Sivov : comctl32/header: Process input order array more accurately.
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: 5517209a241f34506533a892aee8c09c2d2f65ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5517209a241f34506533a892a…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Sun Oct 18 15:21:00 2009 +0400 comctl32/header: Process input order array more accurately. --- dlls/comctl32/header.c | 58 ++++++++++++++++++--- dlls/comctl32/tests/header.c | 121 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 172 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index d84965c..dce1d8c 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -1214,20 +1214,64 @@ HEADER_GetOrderArray(const HEADER_INFO *infoPtr, INT size, LPINT order) return TRUE; } +/* Returns index of first duplicate 'value' from [0,to) range, + or -1 if there isn't any */ +static INT has_duplicate(INT *array, INT to, INT value) +{ + INT i; + for(i = 0; i < to; i++) + if (array[i] == value) return i; + return -1; +} + +/* returns next available value from [0,max] not to duplicate in [0,to) */ +static INT get_nextvalue(INT *array, INT to, INT max) +{ + INT i; + for(i = 0; i < max; i++) + if (has_duplicate(array, to, i) == -1) return i; + return 0; +} + static LRESULT HEADER_SetOrderArray(HEADER_INFO *infoPtr, INT size, const INT *order) { - INT i; HEADER_ITEM *lpItem; + INT i; - if ((UINT)size <infoPtr->uNumItem) + if ((UINT)size != infoPtr->uNumItem) return FALSE; - memcpy(infoPtr->order, order, infoPtr->uNumItem * sizeof(INT)); + + for (i=0; i<size; i++) + { + if (order[i] >= size || order[i] < 0) + /* on invalid index get next available */ + /* FIXME: if i==0 array item is out of range behaviour is + different, see tests */ + infoPtr->order[i] = get_nextvalue(infoPtr->order, i, size); + else + { + INT j, dup; + + infoPtr->order[i] = order[i]; + j = i; + /* remove duplicates */ + while ((dup = has_duplicate(infoPtr->order, j, order[j])) != -1) + { + INT next; + + next = get_nextvalue(infoPtr->order, j, size); + infoPtr->order[dup] = next; + j--; + } + } + } + /* sync with item data */ for (i=0; i<size; i++) - { - lpItem = &infoPtr->items[*order++]; - lpItem->iOrder=i; - } + { + lpItem = &infoPtr->items[infoPtr->order[i]]; + lpItem->iOrder = i; + } HEADER_SetItemBounds(infoPtr); InvalidateRect(infoPtr->hwndSelf, NULL, FALSE); return TRUE; diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index 2fecaee..283c568 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -1689,6 +1689,126 @@ static int init(void) return 1; } +/* maximum 8 items allowed */ +static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected, + int todo, int line) +{ + int count, i; + INT order[8]; + DWORD ret, array = 0; + + count = SendMessage(hwnd, HDM_GETITEMCOUNT, 0, 0); + + /* initial order */ + for(i = 1; i<=count; i++) + order[i-1] = start>>(4*(count-i)) & 0xf; + + ret = SendMessage(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order); + ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARAY to succeed, got %d\n", ret); + + /* new order */ + for(i = 1; i<=count; i++) + order[i-1] = set>>(4*(count-i)) & 0xf; + ret = SendMessage(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order); + ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARAY to succeed, got %d\n", ret); + + /* check actual order */ + ret = SendMessage(hwnd, HDM_GETORDERARRAY, count, (LPARAM)order); + ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARAY to succeed, got %d\n", ret); + for(i = 1; i<=count; i++) + array |= order[i-1]<<(4*(count-i)); + + if (todo) { + todo_wine + ok_(__FILE__, line)(array == expected, "Expected %x, got %x\n", expected, array); + } + else + ok_(__FILE__, line)(array == expected, "Expected %x, got %x\n", expected, array); +} + +static void test_hdm_orderarray(void) +{ + HWND hwnd; + INT order[5]; + DWORD ret; + + hwnd = create_header_control(); + + /* three items */ + addItem(hwnd, 0, NULL); + addItem(hwnd, 1, NULL); + addItem(hwnd, 2, NULL); + + ret = SendMessage(hwnd, HDM_GETORDERARRAY, 3, (LPARAM)order); + if (!ret) + { + win_skip("HDM_GETORDERARRAY not implemented.\n"); + DestroyWindow(hwnd); + return; + } + + expect(0, order[0]); + expect(1, order[1]); + expect(2, order[2]); + +if (0) +{ + /* null pointer, crashes native */ + ret = SendMessage(hwnd, HDM_SETORDERARRAY, 3, (LPARAM)NULL); + expect(FALSE, ret); +} + /* count out of limits */ + ret = SendMessage(hwnd, HDM_SETORDERARRAY, 5, (LPARAM)order); + expect(FALSE, ret); + /* count out of limits */ + ret = SendMessage(hwnd, HDM_SETORDERARRAY, 2, (LPARAM)order); + expect(FALSE, ret); + + /* try with out of range item index */ + /* (0,1,2)->(1,0,3) => (1,0,2) */ + check_orderarray(hwnd, 0x120, 0x103, 0x102, FALSE, __LINE__); + /* (1,0,2)->(3,0,1) => (0,2,1) */ + check_orderarray(hwnd, 0x102, 0x301, 0x021, TRUE, __LINE__); + /* (0,2,1)->(2,3,1) => (2,0,1) */ + check_orderarray(hwnd, 0x021, 0x231, 0x201, FALSE, __LINE__); + + /* (0,1,2)->(0,2,2) => (0,1,2) */ + check_orderarray(hwnd, 0x012, 0x022, 0x012, FALSE, __LINE__); + + addItem(hwnd, 3, NULL); + + /* (0,1,2,3)->(0,1,2,2) => (0,1,3,2) */ + check_orderarray(hwnd, 0x0123, 0x0122, 0x0132, FALSE, __LINE__); + /* (0,1,2,3)->(0,1,3,3) => (0,1,2,3) */ + check_orderarray(hwnd, 0x0123, 0x0133, 0x0123, FALSE, __LINE__); + /* (0,1,2,3)->(0,4,2,3) => (0,1,2,3) */ + check_orderarray(hwnd, 0x0123, 0x0423, 0x0123, FALSE, __LINE__); + /* (0,1,2,3)->(4,0,1,2) => (0,1,3,2) */ + check_orderarray(hwnd, 0x0123, 0x4012, 0x0132, TRUE, __LINE__); + /* (0,1,3,2)->(4,0,1,4) => (0,3,1,2) */ + check_orderarray(hwnd, 0x0132, 0x4014, 0x0312, TRUE, __LINE__); + /* (0,1,2,3)->(4,1,0,2) => (1,0,3,2) */ + check_orderarray(hwnd, 0x0123, 0x4102, 0x1032, TRUE, __LINE__); + /* (0,1,2,3)->(0,1,4,2) => (0,1,2,3) */ + check_orderarray(hwnd, 0x0123, 0x0142, 0x0132, FALSE, __LINE__); + /* (0,1,2,3)->(4,4,4,4) => (0,1,2,3) */ + check_orderarray(hwnd, 0x0123, 0x4444, 0x0123, FALSE, __LINE__); + /* (0,1,2,3)->(4,4,1,2) => (0,1,3,2) */ + check_orderarray(hwnd, 0x0123, 0x4412, 0x0132, TRUE, __LINE__); + /* (0,1,2,3)->(4,4,4,1) => (0,2,3,1) */ + check_orderarray(hwnd, 0x0123, 0x4441, 0x0231, TRUE, __LINE__); + /* (0,1,2,3)->(1,4,4,4) => (1,0,2,3) */ + check_orderarray(hwnd, 0x0123, 0x1444, 0x1023, FALSE, __LINE__); + /* (0,1,2,3)->(4,2,4,1) => (0,2,3,1) */ + check_orderarray(hwnd, 0x0123, 0x4241, 0x0231, FALSE, __LINE__); + /* (0,1,2,3)->(4,2,0,1) => (2,0,3,1) */ + check_orderarray(hwnd, 0x0123, 0x4201, 0x2031, TRUE, __LINE__); + /* (3,2,1,0)->(4,2,0,1) => (3,2,0,1) */ + check_orderarray(hwnd, 0x3210, 0x4201, 0x3201, FALSE, __LINE__); + + DestroyWindow(hwnd); +} + START_TEST(header) { HWND parent_hwnd; @@ -1700,6 +1820,7 @@ START_TEST(header) test_header_control(); test_header_order(); + test_hdm_orderarray(); test_customdraw(); DestroyWindow(hHeaderParentWnd);
1
0
0
0
Nikolay Sivov : comctl32/treeview: Erase background on WM_PAINT if BeginPaint() tells us to do it.
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: 76859b0f47ef98eb932cfc220e5b1afa81a4f0a3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=76859b0f47ef98eb932cfc220…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Sat Oct 17 17:23:43 2009 +0400 comctl32/treeview: Erase background on WM_PAINT if BeginPaint() tells us to do it. --- dlls/comctl32/tests/treeview.c | 12 ++++++++ dlls/comctl32/treeview.c | 59 ++++++++++++++++++++++++++++++--------- 2 files changed, 57 insertions(+), 14 deletions(-) diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 3091127..adc7422 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -928,6 +928,17 @@ static void test_itemedit(void) DestroyWindow(hTree); } +static void test_treeview_classinfo(void) +{ + WNDCLASSA cls; + + memset(&cls, 0, sizeof(cls)); + GetClassInfo(GetModuleHandleA("comctl32.dll"), WC_TREEVIEWA, &cls); + ok(cls.hbrBackground == NULL, "Expected NULL background brush, got %p\n", cls.hbrBackground); + ok(cls.style == (CS_GLOBALCLASS | CS_DBLCLKS), "Expected got %x\n", cls.style); + expect(0, cls.cbClsExtra); +} + START_TEST(treeview) { HMODULE hComctl32; @@ -976,6 +987,7 @@ START_TEST(treeview) test_callback(); test_expandinvisible(); test_itemedit(); + test_treeview_classinfo(); PostMessageA(hMainWnd, WM_CLOSE, 0, 0); while(GetMessageA(&msg,0,0,0)) { diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 29db19a..bff4b81 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -2788,19 +2788,27 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr) infoPtr->uInternalStatus &= ~TV_HSCROLL; } -/* CtrlSpy doesn't mention this, but CorelDRAW's object manager needs it. */ -static LRESULT -TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hDC) +static void +TREEVIEW_FillBkgnd(const TREEVIEW_INFO *infoPtr, HDC hdc, const RECT *rc) { HBRUSH hBrush; COLORREF clrBk = infoPtr->clrBk == -1 ? comctl32_color.clrWindow: infoPtr->clrBk; + hBrush = CreateSolidBrush(clrBk); + FillRect(hdc, rc, hBrush); + DeleteObject(hBrush); +} + +/* CtrlSpy doesn't mention this, but CorelDRAW's object manager needs it. */ +static LRESULT +TREEVIEW_EraseBackground(const TREEVIEW_INFO *infoPtr, HDC hdc) +{ RECT rect; - hBrush = CreateSolidBrush(clrBk); + TRACE("%p\n", infoPtr); + GetClientRect(infoPtr->hwnd, &rect); - FillRect(hDC, &rect, hBrush); - DeleteObject(hBrush); + TREEVIEW_FillBkgnd(infoPtr, hdc, &rect); return 1; } @@ -2860,7 +2868,7 @@ TREEVIEW_Invalidate(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item) } static LRESULT -TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, WPARAM wParam) +TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, HDC hdc_ref) { HDC hdc; PAINTSTRUCT ps; @@ -2868,27 +2876,48 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, WPARAM wParam) TRACE("\n"); - if (wParam) + if (hdc_ref) { - hdc = (HDC)wParam; - GetClientRect(infoPtr->hwnd, &rc); - TREEVIEW_EraseBackground(infoPtr, hdc); + hdc = hdc_ref; + GetClientRect(infoPtr->hwnd, &rc); } else { hdc = BeginPaint(infoPtr->hwnd, &ps); - rc = ps.rcPaint; + rc = ps.rcPaint; + if(ps.fErase) + TREEVIEW_FillBkgnd(infoPtr, hdc, &rc); } if(infoPtr->bRedraw) /* WM_SETREDRAW sets bRedraw */ TREEVIEW_Refresh(infoPtr, hdc, &rc); - if (!wParam) + if (!hdc_ref) EndPaint(infoPtr->hwnd, &ps); return 0; } +static LRESULT +TREEVIEW_PrintClient(TREEVIEW_INFO *infoPtr, HDC hdc, DWORD options) +{ + FIXME("Partial Stub: (hdc=%p options=0x%08x)\n", hdc, options); + + if ((options & PRF_CHECKVISIBLE) && !IsWindowVisible(infoPtr->hwnd)) + return 0; + + if (options & PRF_ERASEBKGND) + TREEVIEW_EraseBackground(infoPtr, hdc); + + if (options & PRF_CLIENT) + { + RECT rc; + GetClientRect(infoPtr->hwnd, &rc); + TREEVIEW_Refresh(infoPtr, hdc, &rc); + } + + return 0; +} /* Sorting **************************************************************/ @@ -5707,8 +5736,10 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TREEVIEW_NotifyFormat(infoPtr, (HWND)wParam, (UINT)lParam); case WM_PRINTCLIENT: + return TREEVIEW_PrintClient(infoPtr, (HDC)wParam, lParam); + case WM_PAINT: - return TREEVIEW_Paint(infoPtr, wParam); + return TREEVIEW_Paint(infoPtr, (HDC)wParam); case WM_RBUTTONDOWN: return TREEVIEW_RButtonDown(infoPtr, lParam);
1
0
0
0
Wilfried Pasquazzo : oleaut32: Updated IPicture_Render testcase to pass on all older Windows.
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: a00d2235aac2d5e719c95933d1cd20233f81019d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a00d2235aac2d5e719c95933d…
Author: Wilfried Pasquazzo <wilfried.pasquazzo(a)gmail.com> Date: Sun Oct 18 20:42:47 2009 +0200 oleaut32: Updated IPicture_Render testcase to pass on all older Windows. --- dlls/oleaut32/tests/olepicture.c | 27 +++++++++++++++++++-------- 1 files changed, 19 insertions(+), 8 deletions(-) diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index 42f58ae..55d883b 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -596,7 +596,7 @@ static void test_Render(void) PICTDESC desc; OLE_XSIZE_HIMETRIC pWidth; OLE_YSIZE_HIMETRIC pHeight; - COLORREF result; + COLORREF result, expected; HDC hdc = GetDC(0); /* test IPicture::Render return code on uninitialized picture */ @@ -657,18 +657,29 @@ static void test_Render(void) SetPixelV(hdc, 0, 0, 0x00F0F0F0); SetPixelV(hdc, 5, 5, 0x00F0F0F0); SetPixelV(hdc, 10, 10, 0x00F0F0F0); + expected = GetPixel(hdc, 0, 0); - IPicture_Render(pic, hdc, 1, 1, 9, 9, 0, 0, pWidth, -pHeight, NULL); + hres = IPicture_Render(pic, hdc, 1, 1, 9, 9, 0, 0, pWidth, -pHeight, NULL); + ole_expect(hres, S_OK); + + if(hres != S_OK) { + IPicture_Release(pic); + ReleaseDC(NULL, hdc); + return; + } + /* Evaluate the rendered Icon */ result = GetPixel(hdc, 0, 0); - ok(result == 0x00F0F0F0, - "Color at 0,0 should be unchanged 0xF0F0F0, but was 0x%06X\n", result); + ok(result == expected, + "Color at 0,0 should be unchanged 0x%06X, but was 0x%06X\n", expected, result); result = GetPixel(hdc, 5, 5); - ok(result != 0x00F0F0F0, - "Color at 5,5 should have changed, but still was 0x%06X\n", result); + ok(result != expected || + broken(result == expected), /* WinNT 4.0 and older may claim they drew */ + /* the icon, even if they didn't. */ + "Color at 5,5 should have changed, but still was 0x%06X\n", expected); result = GetPixel(hdc, 10, 10); - ok(result == 0x00F0F0F0, - "Color at 10,10 should be unchanged 0xF0F0F0, but was 0x%06X\n", result); + ok(result == expected, + "Color at 10,10 should be unchanged 0x%06X, but was 0x%06X\n", expected, result); IPicture_Release(pic); ReleaseDC(NULL, hdc);
1
0
0
0
Alexandre Julliard : gdiplus: Remove a useless inline specifier.
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: 0065a115c6a3bd2f0b48e4f6fa59fc40e9bec499 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0065a115c6a3bd2f0b48e4f6f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 19 11:44:39 2009 +0200 gdiplus: Remove a useless inline specifier. --- dlls/gdiplus/gdiplus.c | 2 +- dlls/gdiplus/gdiplus_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 0effc71..9fe9332 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -418,7 +418,7 @@ void convert_32bppARGB_to_32bppPARGB(UINT width, UINT height, } /* recursive deletion of GpRegion nodes */ -inline void delete_element(region_element* element) +void delete_element(region_element* element) { switch(element->type) { diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 02c03dc..dfff66c 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -61,7 +61,7 @@ extern BOOL lengthen_path(GpPath *path, INT len); extern GpStatus trace_path(GpGraphics *graphics, GpPath *path); typedef struct region_element region_element; -extern inline void delete_element(region_element *element); +extern void delete_element(region_element *element); static inline INT roundr(REAL x) {
1
0
0
0
Alexandre Julliard : ws2_32: Set Information to 0 upon completion of an async shutdown.
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: 190d7e74ec0ba503a5680592081ee03ff81fbe71 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=190d7e74ec0ba503a56805920…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Oct 19 11:44:20 2009 +0200 ws2_32: Set Information to 0 upon completion of an async shutdown. --- dlls/ws2_32/socket.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 7c81bc9..a8d3efc 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -1503,6 +1503,7 @@ static NTSTATUS WS2_async_shutdown( void* user, PIO_STATUS_BLOCK iosb, NTSTATUS break; } iosb->u.Status = status; + iosb->Information = 0; *apc = ws2_async_apc; return status; }
1
0
0
0
Jacek Caban : shlwapi: Added ParseURL[AW] tests.
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: 82cb0fc7e0ca5eb71c7a83530e410ba691340f03 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=82cb0fc7e0ca5eb71c7a83530…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Oct 18 21:49:58 2009 +0200 shlwapi: Added ParseURL[AW] tests. --- dlls/shlwapi/tests/url.c | 85 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 84 insertions(+), 1 deletions(-) diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 39cf00b..0c2900e 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -31,6 +31,8 @@ /* ################ */ static HMODULE hShlwapi; static HRESULT (WINAPI *pUrlCanonicalizeW)(LPCWSTR, LPWSTR, LPDWORD, DWORD); +static HRESULT (WINAPI *pParseURLA)(LPCSTR,PARSEDURLA*); +static HRESULT (WINAPI *pParseURLW)(LPCWSTR,PARSEDURLW*); static const char* TEST_URL_1 = "
http://www.winehq.org/tests?date=10/10/1923
"; static const char* TEST_URL_2 = "
http://localhost:8080/tests%2e.html?date=Mon%2010/10/1923
"; @@ -284,7 +286,8 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = { {"
http://xxxxxxxxx
","outbind:wine17/dir",URL_PLUGGABLE_PROTOCOL, S_OK,"outbind:wine17/dir"}, {"xxx://xxxxxxxxx","ftp:wine18/dir",URL_PLUGGABLE_PROTOCOL, S_OK,"ftp:wine18/dir"}, {"ftp://xxxxxxxxx/","xxx:wine19/dir",URL_PLUGGABLE_PROTOCOL, S_OK,"xxx:wine19/dir"}, - {"outbind://xxxxxxxxx/","http:wine20/dir",URL_PLUGGABLE_PROTOCOL, S_OK,"http:wine20/dir"} + {"outbind://xxxxxxxxx/","http:wine20/dir",URL_PLUGGABLE_PROTOCOL, S_OK,"http:wine20/dir"}, + {"file:///c:/dir/file.txt","index.html?test=c:/abc",URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO,S_OK,"file:///c:/dir/index.html?test=c:/abc"} }; /* ################ */ @@ -976,6 +979,83 @@ static void test_UrlUnescape(void) } +static const struct parse_url_test_t { + const char *url; + HRESULT hres; + UINT protocol_len; + UINT scheme; +} parse_url_tests[] = { + {"
http://www.winehq.org/
",S_OK,4,URL_SCHEME_HTTP}, + {"
https://www.winehq.org/
",S_OK,5,URL_SCHEME_HTTPS}, + {"
ftp://www.winehq.org/
",S_OK,3,URL_SCHEME_FTP}, + {"test.txt?test=c:/dir",0x80041001}, + {"test.txt",0x80041001}, + {"
xxx://www.winehq.org/
",S_OK,3,URL_SCHEME_UNKNOWN}, + {"
1xx://www.winehq.org/
",S_OK,3,URL_SCHEME_UNKNOWN}, + {"-xx://www.winehq.org/",S_OK,3,URL_SCHEME_UNKNOWN}, + {"
xx0://www.winehq.org/
",S_OK,3,URL_SCHEME_UNKNOWN}, + {"
x://www.winehq.org/
",0x80041001}, + {"
xx$://www.winehq.org/
",0x80041001}, + {"
htt?p://www.winehq.org/
",0x80041001}, + {"
ab-://www.winehq.org/
",S_OK,3,URL_SCHEME_UNKNOWN}, + {"
http://www.winehq.org/
",0x80041001}, +}; + +static void test_ParseURL(void) +{ + const struct parse_url_test_t *test; + WCHAR url[INTERNET_MAX_URL_LENGTH]; + PARSEDURLA parseda; + PARSEDURLW parsedw; + HRESULT hres; + + for(test = parse_url_tests; test < parse_url_tests + sizeof(parse_url_tests)/sizeof(*parse_url_tests); test++) { + memset(&parseda, 0xd0, sizeof(parseda)); + parseda.cbSize = sizeof(parseda); + hres = pParseURLA(test->url, &parseda); + ok(hres == test->hres, "ParseURL failed: %08x, expected %08x\n", hres, test->hres); + if(hres == S_OK) { + ok(parseda.pszProtocol == test->url, "parseda.pszProtocol = %s, expected %s\n", + parseda.pszProtocol, test->url); + ok(parseda.cchProtocol == test->protocol_len, "parseda.cchProtocol = %d, expected %d\n", + parseda.cchProtocol, test->protocol_len); + ok(parseda.pszSuffix == test->url+test->protocol_len+1, "parseda.pszSuffix = %s, expected %s\n", + parseda.pszSuffix, test->url+test->protocol_len+1); + ok(parseda.cchSuffix == strlen(test->url+test->protocol_len+1), + "parseda.pszSuffix = %d, expected %d\n", + parseda.cchSuffix, strlen(test->url+test->protocol_len+1)); + ok(parseda.nScheme == test->scheme, "parseda.nScheme = %d, expected %d\n", + parseda.nScheme, test->scheme); + }else { + ok(!parseda.pszProtocol, "parseda.pszProtocol = %p\n", parseda.pszProtocol); + ok(parseda.nScheme == 0xd0d0d0d0, "nScheme = %d\n", parseda.nScheme); + } + + MultiByteToWideChar(CP_ACP, 0, test->url, -1, url, sizeof(url)/sizeof(WCHAR)); + + memset(&parsedw, 0xd0, sizeof(parsedw)); + parsedw.cbSize = sizeof(parsedw); + hres = pParseURLW(url, &parsedw); + ok(hres == test->hres, "ParseURL failed: %08x, expected %08x\n", hres, test->hres); + if(hres == S_OK) { + ok(parsedw.pszProtocol == url, "parsedw.pszProtocol = %s, expected %s\n", + wine_dbgstr_w(parsedw.pszProtocol), wine_dbgstr_w(url)); + ok(parsedw.cchProtocol == test->protocol_len, "parsedw.cchProtocol = %d, expected %d\n", + parsedw.cchProtocol, test->protocol_len); + ok(parsedw.pszSuffix == url+test->protocol_len+1, "parsedw.pszSuffix = %s, expected %s\n", + wine_dbgstr_w(parsedw.pszSuffix), wine_dbgstr_w(url+test->protocol_len+1)); + ok(parsedw.cchSuffix == strlen(test->url+test->protocol_len+1), + "parsedw.pszSuffix = %d, expected %d\n", + parsedw.cchSuffix, strlen(test->url+test->protocol_len+1)); + ok(parsedw.nScheme == test->scheme, "parsedw.nScheme = %d, expected %d\n", + parsedw.nScheme, test->scheme); + }else { + ok(!parsedw.pszProtocol, "parsedw.pszProtocol = %p\n", parseda.pszProtocol); + ok(parsedw.nScheme == 0xd0d0d0d0, "nScheme = %d\n", parsedw.nScheme); + } + } +} + /* ########################### */ START_TEST(url) @@ -983,6 +1063,8 @@ START_TEST(url) hShlwapi = GetModuleHandleA("shlwapi.dll"); pUrlCanonicalizeW = (void *) GetProcAddress(hShlwapi, "UrlCanonicalizeW"); + pParseURLA = (void*)GetProcAddress(hShlwapi, (LPCSTR)1); + pParseURLW = (void*)GetProcAddress(hShlwapi, (LPCSTR)2); test_UrlApplyScheme(); test_UrlHash(); @@ -994,5 +1076,6 @@ START_TEST(url) test_UrlCreateFromPath(); test_UrlIs(); test_UrlUnescape(); + test_ParseURL(); }
1
0
0
0
Jacek Caban : shlwapi: Make more strict restriction for URL scheme and fix error handling in ParseURLW .
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: 4d592ae84fbb16fec55a3e73f7bc1e2b45e85705 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4d592ae84fbb16fec55a3e73f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Oct 18 21:49:41 2009 +0200 shlwapi: Make more strict restriction for URL scheme and fix error handling in ParseURLW. --- dlls/shlwapi/tests/url.c | 2 +- dlls/shlwapi/url.c | 42 +++++++++++++++--------------------------- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index f135f2a..39cf00b 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -131,7 +131,7 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = { {"res:///c:\\tests\\foo bar", 0, S_OK, "res:///c:\\tests\\foo bar", TRUE}, {"res:///c:\\tests\\foo bar", URL_DONT_SIMPLIFY, S_OK, "res:///c:\\tests\\foo bar", TRUE}, {"A", 0, S_OK, "A", FALSE}, - {"/uri-res/N2R?urn:sha1:B3K", URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/, S_OK, "/uri-res/N2R?urn:sha1:B3K", TRUE} /*LimeWire online installer calls this*/, + {"/uri-res/N2R?urn:sha1:B3K", URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/, S_OK, "/uri-res/N2R?urn:sha1:B3K", FALSE} /*LimeWire online installer calls this*/, {"http:www.winehq.org/dir/../index.html", 0, S_OK, "http:www.winehq.org/index.html"}, }; diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 1b8803c..2b7a8cd 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -180,38 +180,26 @@ HRESULT WINAPI ParseURLA(LPCSTR x, PARSEDURLA *y) */ HRESULT WINAPI ParseURLW(LPCWSTR x, PARSEDURLW *y) { - DWORD cnt; + const WCHAR *ptr = x; - y->nScheme = URL_SCHEME_INVALID; - if (y->cbSize != sizeof(*y)) return E_INVALIDARG; - /* FIXME: leading white space generates error of 0x80041001 which - * is undefined - */ - if (*x <= ' ') return 0x80041001; - cnt = 0; - y->cchProtocol = 0; - y->pszProtocol = x; - while (*x) { - if (*x == ':') { - y->cchProtocol = cnt; - cnt = -1; - y->pszSuffix = x+1; - break; - } - x++; - cnt++; - } + TRACE("%s %p\n", debugstr_w(x), y); + + if(y->cbSize != sizeof(*y)) + return E_INVALIDARG; + + while(*ptr && (isalnumW(*ptr) || *ptr == '-')) + ptr++; - /* check for no scheme in string start */ - /* (apparently schemes *must* be larger than a single character) */ - if ((*x == '\0') || (y->cchProtocol <= 1)) { + if (*ptr != ':' || ptr <= x+1) { y->pszProtocol = NULL; return 0x80041001; } - /* found scheme, set length of remainder */ - y->cchSuffix = lstrlenW(y->pszSuffix); - y->nScheme = get_scheme_code(y->pszProtocol, y->cchProtocol); + y->pszProtocol = x; + y->cchProtocol = ptr-x; + y->pszSuffix = ptr+1; + y->cchSuffix = strlenW(y->pszSuffix); + y->nScheme = get_scheme_code(x, ptr-x); return S_OK; }
1
0
0
0
Jacek Caban : shlwapi: Make more strict restriction for URL scheme and fix error handling in ParseURLA .
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: e57b8526b293560b5731f51f2b06c93b247077c9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e57b8526b293560b5731f51f2…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Oct 18 21:49:18 2009 +0200 shlwapi: Make more strict restriction for URL scheme and fix error handling in ParseURLA. --- dlls/shlwapi/url.c | 43 ++++++++++++++++--------------------------- 1 files changed, 16 insertions(+), 27 deletions(-) diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 66c88a6..1b8803c 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -145,40 +145,29 @@ static DWORD get_scheme_code(LPCWSTR scheme, DWORD scheme_len) HRESULT WINAPI ParseURLA(LPCSTR x, PARSEDURLA *y) { WCHAR scheme[INTERNET_MAX_SCHEME_LENGTH]; - DWORD cnt, len; + const char *ptr = x; + int len; - y->nScheme = URL_SCHEME_INVALID; - if (y->cbSize != sizeof(*y)) return E_INVALIDARG; - /* FIXME: leading white space generates error of 0x80041001 which - * is undefined - */ - if (*x <= ' ') return 0x80041001; - cnt = 0; - y->cchProtocol = 0; - y->pszProtocol = x; - while (*x) { - if (*x == ':') { - y->cchProtocol = cnt; - cnt = -1; - y->pszSuffix = x+1; - break; - } - x++; - cnt++; - } + TRACE("%s %p\n", debugstr_a(x), y); - /* check for no scheme in string start */ - /* (apparently schemes *must* be larger than a single character) */ - if ((*x == '\0') || (y->cchProtocol <= 1)) { + if(y->cbSize != sizeof(*y)) + return E_INVALIDARG; + + while(*ptr && (isalnum(*ptr) || *ptr == '-')) + ptr++; + + if (*ptr != ':' || ptr <= x+1) { y->pszProtocol = NULL; return 0x80041001; } - /* found scheme, set length of remainder */ - y->cchSuffix = lstrlenA(y->pszSuffix); + y->pszProtocol = x; + y->cchProtocol = ptr-x; + y->pszSuffix = ptr+1; + y->cchSuffix = strlen(y->pszSuffix); - len = MultiByteToWideChar(CP_ACP, 0, y->pszProtocol, y->cchProtocol, - scheme, sizeof(scheme)/sizeof(WCHAR)); + len = MultiByteToWideChar(CP_ACP, 0, x, ptr-x, + scheme, sizeof(scheme)/sizeof(WCHAR)); y->nScheme = get_scheme_code(scheme, len); return S_OK;
1
0
0
0
Jacek Caban : shlwapi: Properly handle ParseURL errors in UrlGetPart[AW].
by Alexandre Julliard
19 Oct '09
19 Oct '09
Module: wine Branch: master Commit: a34ed0f6eeee7477ec0e3db40f634d05065a196e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a34ed0f6eeee7477ec0e3db40…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Oct 18 21:48:57 2009 +0200 shlwapi: Properly handle ParseURL errors in UrlGetPart[AW]. --- dlls/shlwapi/url.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index f031297..66c88a6 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -2141,6 +2141,7 @@ HRESULT WINAPI UrlGetPartW(LPCWSTR pszIn, LPWSTR pszOut, LPDWORD pcchOut, BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) { PARSEDURLA base; + HRESULT hres; TRACE("%s\n", debugstr_a(lpstrPath)); @@ -2148,8 +2149,8 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) /* get protocol */ base.cbSize = sizeof(base); - ParseURLA(lpstrPath, &base); - return (base.nScheme != URL_SCHEME_INVALID); + hres = ParseURLA(lpstrPath, &base); + return hres == S_OK && (base.nScheme != URL_SCHEME_INVALID); } /************************************************************************* @@ -2160,6 +2161,7 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath) { PARSEDURLW base; + HRESULT hres; TRACE("%s\n", debugstr_w(lpstrPath)); @@ -2167,8 +2169,8 @@ BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath) /* get protocol */ base.cbSize = sizeof(base); - ParseURLW(lpstrPath, &base); - return (base.nScheme != URL_SCHEME_INVALID); + hres = ParseURLW(lpstrPath, &base); + return hres == S_OK && (base.nScheme != URL_SCHEME_INVALID); } /*************************************************************************
1
0
0
0
← Newer
1
...
49
50
51
52
53
54
55
...
121
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Results per page:
10
25
50
100
200