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
March 2012
----- 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
710 discussions
Start a n
N
ew thread
Owen Rudge : comctl32/datetime: Don't check box if no valid date set.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: 9147e7fd2246da9ec8e698f00458d429e90ab573 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9147e7fd2246da9ec8e698f00…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Thu Mar 8 11:34:28 2012 +0000 comctl32/datetime: Don't check box if no valid date set. --- dlls/comctl32/datetime.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index d67e6e3..f29b2d2 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -1402,7 +1402,7 @@ DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRU infoPtr->hwndCheckbut = CreateWindowExW (0, WC_BUTTONW, 0, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, 2, 2, 13, 13, infoPtr->hwndSelf, 0, (HINSTANCE)GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_HINSTANCE), 0); - SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, 1, 0); + SendMessageW (infoPtr->hwndCheckbut, BM_SETCHECK, infoPtr->dateValid ? 1 : 0, 0); } if ( (lpss->styleOld & DTS_SHOWNONE) && !(lpss->styleNew & DTS_SHOWNONE) ) { DestroyWindow(infoPtr->hwndCheckbut);
1
0
0
0
Owen Rudge : comctl32/datetime: Don't allow an invalid year to be typed in.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: 9de240bd0ea38c1c23803c01c425cc0c57fe5cd8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9de240bd0ea38c1c23803c01c…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Thu Mar 8 11:34:23 2012 +0000 comctl32/datetime: Don't allow an invalid year to be typed in. --- dlls/comctl32/datetime.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index 3ad9204..d67e6e3 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -847,6 +847,7 @@ DATETIME_ApplySelectedField (DATETIME_INFO *infoPtr) int fieldNum = infoPtr->select & DTHT_DATEFIELD; int i, val=0, clamp_day=0; SYSTEMTIME date = infoPtr->date; + int oldyear; if (infoPtr->select == -1 || infoPtr->nCharsEntered == 0) return; @@ -859,13 +860,25 @@ DATETIME_ApplySelectedField (DATETIME_INFO *infoPtr) switch (infoPtr->fieldspec[fieldNum]) { case ONEDIGITYEAR: case TWODIGITYEAR: + oldyear = date.wYear; date.wYear = date.wYear - (date.wYear%100) + val; - clamp_day = 1; + + if (DATETIME_IsDateInValidRange(infoPtr, &date)) + clamp_day = 1; + else + date.wYear = oldyear; + break; case INVALIDFULLYEAR: case FULLYEAR: + oldyear = date.wYear; date.wYear = val; - clamp_day = 1; + + if (DATETIME_IsDateInValidRange(infoPtr, &date)) + clamp_day = 1; + else + date.wYear = oldyear; + break; case ONEDIGITMONTH: case TWODIGITMONTH:
1
0
0
0
Owen Rudge : comctl32/datetime: Ensure up/down/home/ end increments remain within bounds.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: 3f93230812f5db519d5aa11af039ff2b3b289a34 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3f93230812f5db519d5aa11af…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Thu Mar 8 11:34:19 2012 +0000 comctl32/datetime: Ensure up/down/home/end increments remain within bounds. --- dlls/comctl32/datetime.c | 33 +++++++++++++++++++++++++++++++-- 1 files changed, 31 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index 1443c35..3ad9204 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -506,6 +506,9 @@ static void DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta) { SYSTEMTIME *date = &infoPtr->date; + SYSTEMTIME range[2]; + DWORD limits; + BOOL min; TRACE ("%d\n", number); if ((number > infoPtr->nrFields) || (number < 0)) return; @@ -516,7 +519,13 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta) case ONEDIGITYEAR: case TWODIGITYEAR: case FULLYEAR: - date->wYear = wrap(date->wYear, delta, 1752, 9999); + if (delta == INT_MIN) + date->wYear = 1752; + else if (delta == INT_MAX) + date->wYear = 9999; + else + date->wYear = max(min(date->wYear + delta, 9999), 1752); + if (date->wDay > MONTHCAL_MonthLength(date->wMonth, date->wYear)) /* This can happen when moving away from a leap year. */ date->wDay = MONTHCAL_MonthLength(date->wMonth, date->wYear); @@ -573,8 +582,28 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta) date->wMinute = 0; date->wHour = 0; } -} + /* Ensure time is within bounds */ + limits = SendMessageW (infoPtr->hMonthCal, MCM_GETRANGE, 0, (LPARAM) &range); + min = ((delta < 0) ? TRUE : FALSE); + + if (limits & (min ? GDTR_MIN : GDTR_MAX)) + { + int i = (min ? 0 : 1); + + if (MONTHCAL_CompareSystemTime(date, &range[i]) == (min ? -1 : 1)) + { + date->wYear = range[i].wYear; + date->wMonth = range[i].wMonth; + date->wDayOfWeek = range[i].wDayOfWeek; + date->wDay = range[i].wDay; + date->wHour = range[i].wHour; + date->wMinute = range[i].wMinute; + date->wSecond = range[i].wSecond; + date->wMilliseconds = range[i].wMilliseconds; + } + } +} static void DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHORT *width)
1
0
0
0
Owen Rudge : comctl32/datetime: Check dates are within range in SetSystemTime.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: c8c3c4be914481d95a9c2790716b9d973e697b37 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c8c3c4be914481d95a9c27907…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Thu Mar 8 11:34:13 2012 +0000 comctl32/datetime: Check dates are within range in SetSystemTime. --- dlls/comctl32/comctl32.h | 1 + dlls/comctl32/datetime.c | 46 +++++++++++++++++++++++++++++++++++++++- dlls/comctl32/monthcal.c | 2 +- dlls/comctl32/tests/datetime.c | 4 +- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/comctl32.h b/dlls/comctl32/comctl32.h index 7355e82..129ab0c 100644 --- a/dlls/comctl32/comctl32.h +++ b/dlls/comctl32/comctl32.h @@ -231,6 +231,7 @@ extern void UPDOWN_Unregister(void) DECLSPEC_HIDDEN; int MONTHCAL_MonthLength(int month, int year) DECLSPEC_HIDDEN; int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace) DECLSPEC_HIDDEN; +LONG MONTHCAL_CompareSystemTime(const SYSTEMTIME *first, const SYSTEMTIME *second) DECLSPEC_HIDDEN; extern void THEMING_Initialize(void) DECLSPEC_HIDDEN; extern void THEMING_Uninitialize(void) DECLSPEC_HIDDEN; diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index 785769a..1443c35 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -138,6 +138,9 @@ static BOOL DATETIME_SendDateTimeChangeNotify (const DATETIME_INFO *infoPtr); static const WCHAR allowedformatchars[] = {'d', 'h', 'H', 'm', 'M', 's', 't', 'y', 'X', 0}; static const int maxrepetition [] = {4,2,2,2,4,2,2,4,-1}; +/* valid date limits */ +static const SYSTEMTIME max_allowed_date = { /* wYear */ 9999, /* wMonth */ 12, /* wDayOfWeek */ 0, /* wDay */ 31 }; +static const SYSTEMTIME min_allowed_date = { /* wYear */ 1752, /* wMonth */ 9, /* wDayOfWeek */ 0, /* wDay */ 14 }; static DWORD DATETIME_GetSystemTime (const DATETIME_INFO *infoPtr, SYSTEMTIME *systime) @@ -153,6 +156,43 @@ DATETIME_GetSystemTime (const DATETIME_INFO *infoPtr, SYSTEMTIME *systime) return GDT_VALID; } +/* Checks value is within configured date range + * + * PARAMETERS + * + * [I] infoPtr : valid pointer to control data + * [I] date : pointer to valid date data to check + * + * RETURN VALUE + * + * TRUE - date within configured range + * FALSE - date is outside configured range + */ +static BOOL DATETIME_IsDateInValidRange(const DATETIME_INFO *infoPtr, const SYSTEMTIME *date) +{ + SYSTEMTIME range[2]; + DWORD limits; + + if ((MONTHCAL_CompareSystemTime(date, &max_allowed_date) == 1) || + (MONTHCAL_CompareSystemTime(date, &min_allowed_date) == -1)) + return FALSE; + + limits = SendMessageW (infoPtr->hMonthCal, MCM_GETRANGE, 0, (LPARAM) &range); + + if (limits & GDTR_MAX) + { + if (MONTHCAL_CompareSystemTime(date, &range[1]) == 1) + return FALSE; + } + + if (limits & GDTR_MIN) + { + if (MONTHCAL_CompareSystemTime(date, &range[0]) == -1) + return FALSE; + } + + return TRUE; +} static BOOL DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *systime) @@ -164,7 +204,7 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *sy systime->wHour, systime->wMinute, systime->wSecond); if (flag == GDT_VALID) { - if (systime->wYear < 1601 || systime->wYear > 30827 || + if (systime->wYear == 0 || systime->wMonth < 1 || systime->wMonth > 12 || systime->wDay < 1 || systime->wDay > MONTHCAL_MonthLength(systime->wMonth, systime->wYear) || @@ -175,6 +215,10 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *sy ) return FALSE; + /* Windows returns true if the date is valid but outside the limits set */ + if (DATETIME_IsDateInValidRange(infoPtr, systime) == FALSE) + return TRUE; + infoPtr->dateValid = TRUE; infoPtr->date = *systime; /* always store a valid day of week */ diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index 1c9572b..a7722ee 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -296,7 +296,7 @@ static void MONTHCAL_CopyDate(const SYSTEMTIME *from, SYSTEMTIME *to) * * Note that no date validation performed, already validated values expected. */ -static LONG MONTHCAL_CompareSystemTime(const SYSTEMTIME *first, const SYSTEMTIME *second) +LONG MONTHCAL_CompareSystemTime(const SYSTEMTIME *first, const SYSTEMTIME *second) { FILETIME ft_first, ft_second; diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index 8fb7d1f..24d339f 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -710,7 +710,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void) expect(1, r); r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]); ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); - todo_wine expect_systime(&refSt, &getSt[0]); + expect_systime(&refSt, &getSt[0]); fill_systime_struct(&st[0], 1977, 1, 0, 1, 0, 0, 0, 0); @@ -718,7 +718,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void) expect(1, r); r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]); ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); - todo_wine expect_systime(&refSt, &getSt[0]); + expect_systime(&refSt, &getSt[0]); ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_and_get_systime_with_limits, "test_dtm_set_and_get_systime_with_limits", FALSE);
1
0
0
0
Owen Rudge : comctl32/tests: Add test for DTM_SETSYSTEMTIME outside range limit.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: 300140e2cb51aae30849425f5ea3317aad06a1d6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=300140e2cb51aae30849425f5…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Thu Mar 8 11:34:08 2012 +0000 comctl32/tests: Add test for DTM_SETSYSTEMTIME outside range limit. --- dlls/comctl32/tests/datetime.c | 62 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 62 insertions(+), 0 deletions(-) diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c index 171da5c..8fb7d1f 100644 --- a/dlls/comctl32/tests/datetime.c +++ b/dlls/comctl32/tests/datetime.c @@ -121,6 +121,18 @@ static const struct message test_dtm_set_and_get_system_time_seq[] = { { 0 } }; +static const struct message test_dtm_set_and_get_systime_with_limits[] = { + { DTM_SETRANGE, sent|wparam, GDTR_MIN | GDTR_MAX }, + { DTM_GETRANGE, sent|wparam, 0 }, + { DTM_SETSYSTEMTIME, sent|wparam, 0 }, + { DTM_GETSYSTEMTIME, sent|wparam, 0 }, + { DTM_SETSYSTEMTIME, sent|wparam, 0 }, + { DTM_GETSYSTEMTIME, sent|wparam, 0 }, + { DTM_SETSYSTEMTIME, sent|wparam, 0 }, + { DTM_GETSYSTEMTIME, sent|wparam, 0 }, + { 0 } +}; + static LRESULT WINAPI datetime_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA); @@ -660,6 +672,55 @@ static void test_dtm_set_and_get_system_time(void) expect(4, (LRESULT)getSt.wDayOfWeek); st.wDayOfWeek = 4; expect_systime(&st, &getSt); +} + +static void test_dtm_set_and_get_systemtime_with_limits(void) +{ + LRESULT r; + SYSTEMTIME st[2], getSt[2], refSt; + HWND hWnd; + + hWnd = create_datetime_control(DTS_SHOWNONE); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + /* set range */ + fill_systime_struct(&st[0], 1980, 1, 3, 23, 14, 34, 37, 465); + fill_systime_struct(&st[1], 2007, 3, 2, 31, 23, 59, 59, 999); + + r = SendMessage(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st); + expect(1, r); + r = SendMessage(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt); + ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r); + expect_systime(&st[0], &getSt[0]); + expect_systime(&st[1], &getSt[1]); + + /* Initially set a valid time */ + fill_systime_struct(&refSt, 1999, 9, 4, 9, 19, 9, 9, 999); + r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&refSt); + expect(1, r); + r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]); + ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); + expect_systime(&refSt, &getSt[0]); + + /* Now set an out-of-bounds time */ + fill_systime_struct(&st[0], 2010, 1, 0, 1, 0, 0, 0, 0); + + r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]); + expect(1, r); + r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]); + ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); + todo_wine expect_systime(&refSt, &getSt[0]); + + fill_systime_struct(&st[0], 1977, 1, 0, 1, 0, 0, 0, 0); + + r = SendMessage(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]); + expect(1, r); + r = SendMessage(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]); + ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r); + todo_wine expect_systime(&refSt, &getSt[0]); + + ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_and_get_systime_with_limits, "test_dtm_set_and_get_systime_with_limits", FALSE); DestroyWindow(hWnd); } @@ -749,6 +810,7 @@ START_TEST(datetime) test_dtm_set_and_get_range(); test_dtm_set_range_swap_min_max(); test_dtm_set_and_get_system_time(); + test_dtm_set_and_get_systemtime_with_limits(); test_wm_set_get_text(); test_dts_shownone(); }
1
0
0
0
Owen Rudge : comctl32/monthcal: Check both min and max ranges in IsDateInValidRange.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: 72f174192b9adc75d47a166f2b28bf28a7c08898 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=72f174192b9adc75d47a166f2…
Author: Owen Rudge <orudge(a)codeweavers.com> Date: Thu Mar 8 11:34:01 2012 +0000 comctl32/monthcal: Check both min and max ranges in IsDateInValidRange. --- dlls/comctl32/monthcal.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index e148a62..1c9572b 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -353,14 +353,17 @@ static BOOL MONTHCAL_IsDateInValidRange(const MONTHCAL_INFO *infoPtr, else if(MONTHCAL_CompareSystemTime(date, &min_allowed_date) == -1) { fix_st = &min_allowed_date; } - else if(infoPtr->rangeValid & GDTR_MAX) { - if((MONTHCAL_CompareSystemTime(date, &infoPtr->maxDate) == 1)) { - fix_st = &infoPtr->maxDate; + else { + if(infoPtr->rangeValid & GDTR_MAX) { + if((MONTHCAL_CompareSystemTime(date, &infoPtr->maxDate) == 1)) { + fix_st = &infoPtr->maxDate; + } } - } - else if(infoPtr->rangeValid & GDTR_MIN) { - if((MONTHCAL_CompareSystemTime(date, &infoPtr->minDate) == -1)) { - fix_st = &infoPtr->minDate; + + if(infoPtr->rangeValid & GDTR_MIN) { + if((MONTHCAL_CompareSystemTime(date, &infoPtr->minDate) == -1)) { + fix_st = &infoPtr->minDate; + } } }
1
0
0
0
Alistair Leslie-Hughes : mscoree: Add CoEEShutDownCOM stub.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: e3ab993647001adbf3ed8be6a794ae58fc0e7a95 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e3ab993647001adbf3ed8be6a…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Sat Mar 3 16:32:47 2012 +1100 mscoree: Add CoEEShutDownCOM stub. --- dlls/mscoree/mscoree.spec | 2 +- dlls/mscoree/mscoree_main.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/mscoree/mscoree.spec b/dlls/mscoree/mscoree.spec index b944c34..ad883c6 100644 --- a/dlls/mscoree/mscoree.spec +++ b/dlls/mscoree/mscoree.spec @@ -9,7 +9,7 @@ @ stub CloseCtrs @ stdcall CLRCreateInstance(ptr ptr ptr) @ stdcall ClrCreateManagedInstance(wstr ptr ptr) -@ stub CoEEShutDownCOM +@ stdcall CoEEShutDownCOM() @ stdcall CoInitializeCor(long) @ stub CoInitializeEE @ stub CoUninitializeCor diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c index b6ae490..1aa120f 100644 --- a/dlls/mscoree/mscoree_main.c +++ b/dlls/mscoree/mscoree_main.c @@ -641,6 +641,11 @@ HRESULT WINAPI DllCanUnloadNow(VOID) return S_FALSE; } +void WINAPI CoEEShutDownCOM(void) +{ + FIXME("stub.\n"); +} + INT WINAPI ND_RU1( const void *ptr, INT offset ) { return *((const BYTE *)ptr + offset);
1
0
0
0
Frédéric Delanoy : winecfg: Avoid unneeded ellipsis in combo box item.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: dd9d4ba9badf1445b7940f507dce18995ac2eb23 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dd9d4ba9badf1445b7940f507…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Wed Mar 7 18:30:23 2012 +0100 winecfg: Avoid unneeded ellipsis in combo box item. --- po/ar.po | 2 +- po/bg.po | 5 +++-- po/ca.po | 5 +++-- po/cs.po | 5 +++-- po/da.po | 4 ++-- po/de.po | 5 +++-- po/el.po | 2 +- po/en.po | 2 +- po/en_US.po | 5 +++-- po/eo.po | 2 +- po/es.po | 5 +++-- po/fa.po | 2 +- po/fi.po | 5 +++-- po/fr.po | 5 +++-- po/he.po | 2 +- po/hi.po | 2 +- po/hu.po | 5 +++-- po/it.po | 5 +++-- po/ja.po | 5 +++-- po/ko.po | 5 +++-- po/lt.po | 5 +++-- po/ml.po | 2 +- po/nb_NO.po | 4 ++-- po/nl.po | 5 +++-- po/or.po | 2 +- po/pa.po | 2 +- po/pl.po | 5 +++-- po/pt_BR.po | 5 +++-- po/pt_PT.po | 5 +++-- po/rm.po | 2 +- po/ro.po | 5 +++-- po/ru.po | 5 +++-- po/sk.po | 5 +++-- po/sl.po | 5 +++-- po/sr_RS(a)cyrillic.po | 2 +- po/sr_RS(a)latin.po | 4 ++-- po/sv.po | 5 +++-- po/te.po | 2 +- po/th.po | 2 +- po/tr.po | 5 +++-- po/uk.po | 5 +++-- po/wa.po | 2 +- po/wine.pot | 2 +- po/zh_CN.po | 4 ++-- po/zh_TW.po | 5 +++-- programs/winecfg/winecfg.rc | 2 +- 46 files changed, 100 insertions(+), 75 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=dd9d4ba9badf1445b7940…
1
0
0
0
Alexandre Julliard : winex11: Never try to clip the cursor if we don' t have XInput2.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: 7c7a509e22a54cd64c6ea0be80303dcaad6e01fb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c7a509e22a54cd64c6ea0be8…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 12 10:33:52 2012 +0100 winex11: Never try to clip the cursor if we don't have XInput2. --- dlls/winex11.drv/mouse.c | 17 +++++------------ 1 files changed, 5 insertions(+), 12 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 332b71d..3dc1196 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -369,7 +369,7 @@ static void disable_xinput2(void) * * Start a pointer grab on the clip window. */ -static BOOL grab_clipping_window( const RECT *clip, BOOL only_with_xinput ) +static BOOL grab_clipping_window( const RECT *clip ) { static const WCHAR messageW[] = {'M','e','s','s','a','g','e',0}; struct x11drv_thread_data *data = x11drv_thread_data(); @@ -386,14 +386,7 @@ static BOOL grab_clipping_window( const RECT *clip, BOOL only_with_xinput ) /* enable XInput2 unless we are already clipping */ if (!data->clip_hwnd) enable_xinput2(); - /* don't clip to 1x1 rectangle if we don't have XInput */ - if (clip->right - clip->left == 1 && clip->bottom - clip->top == 1) only_with_xinput = TRUE; - /* don't clip to fullscreen rectangle either (with 1-pixel offset to catch the dinput case) */ - if (clip->left <= virtual_screen_rect.left + 1 || clip->right >= virtual_screen_rect.right - 1 || - clip->top <= virtual_screen_rect.top + 1 || clip->bottom >= virtual_screen_rect.bottom - 1) - only_with_xinput = TRUE; - - if (only_with_xinput && data->xi2_state != xi_enabled) + if (data->xi2_state != xi_enabled) { WARN( "XInput2 not supported, refusing to clip to %s\n", wine_dbgstr_rect(clip) ); DestroyWindow( msg_hwnd ); @@ -499,7 +492,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd ) GetClipCursor( &clip ); if (clip.left > virtual_screen_rect.left || clip.right < virtual_screen_rect.right || clip.top > virtual_screen_rect.top || clip.bottom < virtual_screen_rect.bottom) - return grab_clipping_window( &clip, FALSE ); + return grab_clipping_window( &clip ); } return 0; } @@ -534,7 +527,7 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset ) if (root_window != DefaultRootWindow( gdi_display )) return FALSE; } TRACE( "win %p clipping fullscreen\n", hwnd ); - return grab_clipping_window( &rect, TRUE ); + return grab_clipping_window( &rect ); } /*********************************************************************** @@ -1310,7 +1303,7 @@ BOOL CDECL X11DRV_ClipCursor( LPCRECT clip ) SendNotifyMessageW( foreground, WM_X11DRV_CLIP_CURSOR, 0, 0 ); return TRUE; } - else if (grab_clipping_window( clip, FALSE )) return TRUE; + else if (grab_clipping_window( clip )) return TRUE; } else /* if currently clipping, check if we should switch to fullscreen clipping */ {
1
0
0
0
Alexandre Julliard : kernel32: Implement the memory resource notification functions.
by Alexandre Julliard
12 Mar '12
12 Mar '12
Module: wine Branch: master Commit: aeaf18077e42b23ff96cbd1192cb47948c767708 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aeaf18077e42b23ff96cbd119…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Mar 12 10:33:32 2012 +0100 kernel32: Implement the memory resource notification functions. --- dlls/kernel32/sync.c | 60 +++++++++++++++++++++++++++++++++++++------ dlls/kernel32/tests/sync.c | 39 ++++++++++++++++++++++++++++ include/winbase.h | 1 + 3 files changed, 91 insertions(+), 9 deletions(-) diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c index acbfab0..08ea8cc 100644 --- a/dlls/kernel32/sync.c +++ b/dlls/kernel32/sync.c @@ -2179,21 +2179,63 @@ BOOL WINAPI BindIoCompletionCallback( HANDLE FileHandle, LPOVERLAPPED_COMPLETION /*********************************************************************** * CreateMemoryResourceNotification (KERNEL32.@) */ -HANDLE WINAPI CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE nt) -{ - FIXME("(%d) stub\n", nt); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return NULL; +HANDLE WINAPI CreateMemoryResourceNotification(MEMORY_RESOURCE_NOTIFICATION_TYPE type) +{ + static const WCHAR lowmemW[] = + {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s', + '\\','L','o','w','M','e','m','o','r','y','C','o','n','d','i','t','i','o','n',0}; + static const WCHAR highmemW[] = + {'\\','K','e','r','n','e','l','O','b','j','e','c','t','s', + '\\','H','i','g','h','M','e','m','o','r','y','C','o','n','d','i','t','i','o','n',0}; + HANDLE ret; + UNICODE_STRING nameW; + OBJECT_ATTRIBUTES attr; + NTSTATUS status; + + switch (type) + { + case LowMemoryResourceNotification: + RtlInitUnicodeString( &nameW, lowmemW ); + break; + case HighMemoryResourceNotification: + RtlInitUnicodeString( &nameW, highmemW ); + break; + default: + SetLastError( ERROR_INVALID_PARAMETER ); + return 0; + } + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = &nameW; + attr.Attributes = 0; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + status = NtOpenEvent( &ret, EVENT_ALL_ACCESS, &attr ); + if (status != STATUS_SUCCESS) + { + SetLastError( RtlNtStatusToDosError(status) ); + return 0; + } + return ret; } /*********************************************************************** * QueryMemoryResourceNotification (KERNEL32.@) */ -BOOL WINAPI QueryMemoryResourceNotification(HANDLE rnh, PBOOL rs) +BOOL WINAPI QueryMemoryResourceNotification(HANDLE handle, PBOOL state) { - FIXME("(%p, %p) stub\n", rnh, rs); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; + switch (WaitForSingleObject( handle, 0 )) + { + case WAIT_OBJECT_0: + *state = TRUE; + return TRUE; + case WAIT_TIMEOUT: + *state = FALSE; + return TRUE; + } + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; } #ifdef __i386__ diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index 07bc2ca..3965458 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -35,6 +35,8 @@ static HANDLE (WINAPI *pCreateWaitableTimerA)(SECURITY_ATTRIBUTES*,BOOL,LPCSTR); static BOOL (WINAPI *pDeleteTimerQueueEx)(HANDLE, HANDLE); static BOOL (WINAPI *pDeleteTimerQueueTimer)(HANDLE, HANDLE, HANDLE); static HANDLE (WINAPI *pOpenWaitableTimerA)(DWORD,BOOL,LPCSTR); +static HANDLE (WINAPI *pCreateMemoryResourceNotification)(MEMORY_RESOURCE_NOTIFICATION_TYPE); +static BOOL (WINAPI *pQueryMemoryResourceNotification)(HANDLE, PBOOL); static void test_signalandwait(void) { @@ -300,6 +302,8 @@ static void test_event(void) SECURITY_ATTRIBUTES sa; SECURITY_DESCRIPTOR sd; ACL acl; + DWORD ret; + BOOL val; /* no sd */ handle = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); @@ -360,6 +364,39 @@ static void test_event(void) ok( GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); CloseHandle( handle ); + + /* resource notifications are events too */ + + if (!pCreateMemoryResourceNotification || !pQueryMemoryResourceNotification) + { + trace( "memory resource notifications not supported\n" ); + return; + } + handle = pCreateMemoryResourceNotification( HighMemoryResourceNotification + 1 ); + ok( !handle, "CreateMemoryResourceNotification succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ret = pQueryMemoryResourceNotification( handle, &val ); + ok( !ret, "QueryMemoryResourceNotification succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + handle = pCreateMemoryResourceNotification( LowMemoryResourceNotification ); + ok( handle != 0, "CreateMemoryResourceNotification failed err %u\n", GetLastError() ); + ret = WaitForSingleObject( handle, 10 ); + ok( ret == WAIT_OBJECT_0 || ret == WAIT_TIMEOUT, "WaitForSingleObject wrong ret %u\n", ret ); + + val = ~0; + ret = pQueryMemoryResourceNotification( handle, &val ); + ok( ret, "QueryMemoryResourceNotification failed err %u\n", GetLastError() ); + ok( val == FALSE || val == TRUE, "wrong value %u\n", val ); + ret = CloseHandle( handle ); + ok( ret, "CloseHandle failed err %u\n", GetLastError() ); + + handle = CreateEventA(NULL, FALSE, FALSE, __FILE__ ": Test Event"); + val = ~0; + ret = pQueryMemoryResourceNotification( handle, &val ); + ok( ret, "QueryMemoryResourceNotification failed err %u\n", GetLastError() ); + ok( val == FALSE || val == TRUE, "wrong value %u\n", val ); + CloseHandle( handle ); } static void test_semaphore(void) @@ -1074,6 +1111,8 @@ START_TEST(sync) pDeleteTimerQueueEx = (void*)GetProcAddress(hdll, "DeleteTimerQueueEx"); pDeleteTimerQueueTimer = (void*)GetProcAddress(hdll, "DeleteTimerQueueTimer"); pOpenWaitableTimerA = (void*)GetProcAddress(hdll, "OpenWaitableTimerA"); + pCreateMemoryResourceNotification = (void *)GetProcAddress(hdll, "CreateMemoryResourceNotification"); + pQueryMemoryResourceNotification = (void *)GetProcAddress(hdll, "QueryMemoryResourceNotification"); test_signalandwait(); test_mutex(); diff --git a/include/winbase.h b/include/winbase.h index 6ec9230..492c63b 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2021,6 +2021,7 @@ WINBASEAPI BOOL WINAPI QueryFullProcessImageNameA(HANDLE,DWORD,LPSTR,PDWO WINBASEAPI BOOL WINAPI QueryFullProcessImageNameW(HANDLE,DWORD,LPWSTR,PDWORD); #define QueryFullProcessImageName WINELIB_NAME_AW(QueryFullProcessImageName) WINBASEAPI BOOL WINAPI QueryInformationJobObject(HANDLE,JOBOBJECTINFOCLASS,LPVOID,DWORD,DWORD*); +WINBASEAPI BOOL WINAPI QueryMemoryResourceNotification(HANDLE,PBOOL); WINBASEAPI BOOL WINAPI QueryPerformanceCounter(LARGE_INTEGER*); WINBASEAPI BOOL WINAPI QueryPerformanceFrequency(LARGE_INTEGER*); WINBASEAPI DWORD WINAPI QueueUserAPC(PAPCFUNC,HANDLE,ULONG_PTR);
1
0
0
0
← Newer
1
...
50
51
52
53
54
55
56
...
71
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
Results per page:
10
25
50
100
200