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
August 2010
----- 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
884 discussions
Start a n
N
ew thread
Piotr Caban : msvcrt: Added _scprintf implementation.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: 600fa766f30b3ceced2b5fdd384852608c090c6c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=600fa766f30b3ceced2b5fdd3…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 01:46:25 2010 +0200 msvcrt: Added _scprintf implementation. --- dlls/msvcr100/msvcr100.spec | 2 +- dlls/msvcr70/msvcr70.spec | 2 +- dlls/msvcr71/msvcr71.spec | 2 +- dlls/msvcr80/msvcr80.spec | 2 +- dlls/msvcr90/msvcr90.spec | 2 +- dlls/msvcrt/msvcrt.spec | 2 +- dlls/msvcrt/wcs.c | 13 +++++++++++++ 7 files changed, 19 insertions(+), 6 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 5e8680b..a1c5a37 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1055,7 +1055,7 @@ @ cdecl _scalb(double long) msvcrt._scalb @ varargs _scanf_l(str ptr) msvcrt._scanf_l @ varargs _scanf_s_l(str ptr) msvcrt._scanf_s_l -@ stub _scprintf +@ varargs _scprintf(str) msvcrt._scprintf @ stub _scprintf_l @ stub _scprintf_p @ stub _scprintf_p_l diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec index 964a0e6..2949b54 100644 --- a/dlls/msvcr70/msvcr70.spec +++ b/dlls/msvcr70/msvcr70.spec @@ -509,7 +509,7 @@ @ cdecl -arch=i386 _safe_fprem() msvcrt._safe_fprem @ cdecl -arch=i386 _safe_fprem1() msvcrt._safe_fprem1 @ cdecl _scalb( double long) msvcrt._scalb -@ stub _scprintf +@ varargs _scprintf(str) msvcrt._scprintf @ varargs _scwprintf(wstr) msvcrt._scwprintf @ cdecl _searchenv(str str ptr) msvcrt._searchenv @ stdcall -i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec index 2483d6b..8d488cf 100644 --- a/dlls/msvcr71/msvcr71.spec +++ b/dlls/msvcr71/msvcr71.spec @@ -504,7 +504,7 @@ @ cdecl _safe_fprem() msvcrt._safe_fprem @ cdecl _safe_fprem1() msvcrt._safe_fprem1 @ cdecl _scalb( double long) msvcrt._scalb -@ stub _scprintf +@ varargs _scprintf(str) msvcrt._scprintf @ varargs _scwprintf(wstr) msvcrt._scwprintf @ cdecl _searchenv(str str ptr) msvcrt._searchenv @ stdcall -i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index f47bd83..a161b64 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -907,7 +907,7 @@ @ cdecl _scalb( double long) msvcrt._scalb @ varargs _scanf_l(str ptr) msvcrt._scanf_l @ varargs _scanf_s_l(str ptr) msvcrt._scanf_s_l -@ stub _scprintf +@ varargs _scprintf(str) msvcrt._scprintf @ stub _scprintf_l @ stub _scprintf_p @ stub _scprintf_p_l diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index fbe5458..d369331 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -893,7 +893,7 @@ @ cdecl _scalb( double long) msvcrt._scalb @ varargs _scanf_l(str ptr) msvcrt._scanf_l @ varargs _scanf_s_l(str ptr) msvcrt._scanf_s_l -@ stub _scprintf +@ varargs _scprintf(str) msvcrt._scprintf @ stub _scprintf_l @ stub _scprintf_p @ stub _scprintf_p_l diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 93bbfd7..6d3e1dd 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -836,7 +836,7 @@ @ cdecl -arch=x86_64 _scalbf(double long) MSVCRT__scalbf @ varargs _scanf_l(str ptr) MSVCRT__scanf_l @ varargs _scanf_s_l(str ptr) MSVCRT__scanf_s_l -# stub _scprintf +@ varargs _scprintf(str) MSVCRT__scprintf # stub _scprintf_l # stub _scprintf_p_l @ varargs _scwprintf(wstr) MSVCRT__scwprintf diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index 529547b..9ee737e 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1120,6 +1120,19 @@ int CDECL MSVCRT__snprintf_s(char *str, unsigned int len, unsigned int count, } /********************************************************************* + * _scprintf (MSVCRT.@) + */ +int CDECL MSVCRT__scprintf(const char *format, ...) +{ + int retval; + __ms_va_list valist; + __ms_va_start(valist, format); + retval = _vscprintf(format, valist); + __ms_va_end(valist); + return retval; +} + +/********************************************************************* * vsnwprintf_internal (INTERNAL) */ static inline int vsnwprintf_internal(MSVCRT_wchar_t *str, MSVCRT_size_t len,
1
0
0
0
Piotr Caban : msvcrt: Added _gmtime32_s and _gmtime64_s implementation.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: 6467c8325fc9cf55f7d066d618495ba1fd5a8bc5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6467c8325fc9cf55f7d066d61…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 01:46:09 2010 +0200 msvcrt: Added _gmtime32_s and _gmtime64_s implementation. --- dlls/msvcr100/msvcr100.spec | 4 +- dlls/msvcr80/msvcr80.spec | 4 +- dlls/msvcr90/msvcr90.spec | 4 +- dlls/msvcrt/msvcrt.spec | 4 +- dlls/msvcrt/tests/time.c | 30 +++++++++++++- dlls/msvcrt/time.c | 94 ++++++++++++++++++++++++++++++++----------- 6 files changed, 107 insertions(+), 33 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index a6b8ec0..5e8680b 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -719,9 +719,9 @@ @ stub _getws_s @ cdecl -i386 _global_unwind2(ptr) msvcrt._global_unwind2 @ cdecl _gmtime32(ptr) msvcrt._gmtime32 -@ stub _gmtime32_s +@ cdecl _gmtime32_s(ptr ptr) msvcrt._gmtime32_s @ cdecl _gmtime64(ptr) msvcrt._gmtime64 -@ stub _gmtime64_s +@ cdecl _gmtime64_s(ptr ptr) msvcrt._gmtime64_s @ cdecl _heapadd(ptr long) msvcrt._heapadd @ cdecl _heapchk() msvcrt._heapchk @ cdecl _heapmin() msvcrt._heapmin diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index ae2a1f8..f47bd83 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -566,9 +566,9 @@ @ stub _getws_s @ cdecl -i386 _global_unwind2(ptr) msvcrt._global_unwind2 @ cdecl _gmtime32(ptr) msvcrt._gmtime32 -@ stub _gmtime32_s +@ cdecl _gmtime32_s(ptr ptr) msvcrt._gmtime32_s @ cdecl _gmtime64(ptr) msvcrt._gmtime64 -@ stub _gmtime64_s +@ cdecl _gmtime64_s(ptr ptr) msvcrt._gmtime64_s @ cdecl _heapadd(ptr long) msvcrt._heapadd @ cdecl _heapchk() msvcrt._heapchk @ cdecl _heapmin() msvcrt._heapmin diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 7000c2d..fbe5458 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -554,9 +554,9 @@ @ stub _getws_s @ cdecl -i386 _global_unwind2(ptr) msvcrt._global_unwind2 @ cdecl _gmtime32(ptr) msvcrt._gmtime32 -@ stub _gmtime32_s +@ cdecl _gmtime32_s(ptr ptr) msvcrt._gmtime32_s @ cdecl _gmtime64(ptr) msvcrt._gmtime64 -@ stub _gmtime64_s +@ cdecl _gmtime64_s(ptr ptr) msvcrt._gmtime64_s @ cdecl _heapadd(ptr long) msvcrt._heapadd @ cdecl _heapchk() msvcrt._heapchk @ cdecl _heapmin() msvcrt._heapmin diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 2ace243..93bbfd7 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -499,9 +499,9 @@ @ cdecl _getws(ptr) MSVCRT__getws @ cdecl -i386 _global_unwind2(ptr) @ cdecl _gmtime32(ptr) MSVCRT__gmtime32 -# stub _gmtime32_s +@ cdecl _gmtime32_s(ptr ptr) MSVCRT__gmtime32_s @ cdecl _gmtime64(ptr) MSVCRT__gmtime64 -# stub _gmtime64_s +@ cdecl _gmtime64_s(ptr ptr) MSVCRT__gmtime64_s @ cdecl _heapadd (ptr long) @ cdecl _heapchk() @ cdecl _heapmin() diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 78d8e09..b11ecf7 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -35,6 +35,7 @@ static __time32_t (__cdecl *p_mkgmtime32)(struct tm*); static struct tm* (__cdecl *p_gmtime32)(__time32_t*); +static errno_t (__cdecl *p_gmtime32_s)(struct tm*, __time32_t*); static errno_t (__cdecl *p_strtime_s)(char*,size_t); static errno_t (__cdecl *p_strdate_s)(char*,size_t); @@ -43,6 +44,7 @@ static void init(void) HMODULE hmod = GetModuleHandleA("msvcrt.dll"); p_gmtime32 = (void*)GetProcAddress(hmod, "_gmtime32"); + p_gmtime32_s = (void*)GetProcAddress(hmod, "_gmtime32_s"); p_mkgmtime32 = (void*)GetProcAddress(hmod, "_mkgmtime32"); p_strtime_s = (void*)GetProcAddress(hmod, "_strtime_s"); p_strdate_s = (void*)GetProcAddress(hmod, "_strdate_s"); @@ -71,13 +73,21 @@ static void test_ctime(void) static void test_gmtime(void) { __time32_t valid, gmt; - struct tm* gmt_tm; + struct tm* gmt_tm, gmt_tm_s; + errno_t err; if(!p_gmtime32) { win_skip("Skipping _gmtime32 tests\n"); return; } + gmt_tm = p_gmtime32(NULL); + ok(gmt_tm == NULL, "gmt_tm != NULL\n"); + + gmt = -1; + gmt_tm = p_gmtime32(&gmt); + ok(gmt_tm == NULL, "gmt_tm != NULL\n"); + gmt = valid = 0; gmt_tm = p_gmtime32(&gmt); if(!gmt_tm) { @@ -133,6 +143,24 @@ static void test_gmtime(void) gmt_tm->tm_isdst = 1; gmt = p_mkgmtime32(gmt_tm); ok(gmt == valid, "gmt = %u\n", gmt); + + if(!p_gmtime32_s) { + win_skip("Skipping _gmtime32_s tests\n"); + return; + } + + errno = 0; + gmt = 0; + err = p_gmtime32_s(NULL, &gmt); + ok(err == EINVAL, "err = %d\n", err); + ok(errno == EINVAL, "errno = %d\n", errno); + + errno = 0; + gmt = -1; + err = p_gmtime32_s(&gmt_tm_s, &gmt); + ok(err == EINVAL, "err = %d\n", err); + ok(errno == EINVAL, "errno = %d\n", errno); + ok(gmt_tm_s.tm_year == -1, "tm_year = %d\n", gmt_tm_s.tm_year); } static void test_mktime(void) diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 5044203..54bbd74 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -232,37 +232,78 @@ struct MSVCRT_tm* CDECL MSVCRT_localtime(const MSVCRT___time32_t* secs) /********************************************************************* * _gmtime64 (MSVCRT.@) */ -struct MSVCRT_tm* CDECL MSVCRT__gmtime64(const MSVCRT___time64_t* secs) +int CDECL MSVCRT__gmtime64_s(struct MSVCRT_tm *res, const MSVCRT___time64_t *secs) { - thread_data_t * const data = msvcrt_get_thread_data(); - int i; - FILETIME ft; - SYSTEMTIME st; + int i; + FILETIME ft; + SYSTEMTIME st; + ULONGLONG time; + + if(!res || !secs || *secs<0) { + if(res) { + res->tm_sec = -1; + res->tm_min = -1; + res->tm_hour = -1; + res->tm_mday = -1; + res->tm_year = -1; + res->tm_mon = -1; + res->tm_wday = -1; + res->tm_yday = -1; + res->tm_isdst = -1; + } + + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } - ULONGLONG time = *secs * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970; + time = *secs * (ULONGLONG)TICKSPERSEC + TICKS_1601_TO_1970; - ft.dwHighDateTime = (UINT)(time >> 32); - ft.dwLowDateTime = (UINT)time; + ft.dwHighDateTime = (UINT)(time >> 32); + ft.dwLowDateTime = (UINT)time; - FileTimeToSystemTime(&ft, &st); + FileTimeToSystemTime(&ft, &st); + + res->tm_sec = st.wSecond; + res->tm_min = st.wMinute; + res->tm_hour = st.wHour; + res->tm_mday = st.wDay; + res->tm_year = st.wYear - 1900; + res->tm_mon = st.wMonth - 1; + res->tm_wday = st.wDayOfWeek; + for (i = res->tm_yday = 0; i < st.wMonth - 1; i++) { + res->tm_yday += MonthLengths[IsLeapYear(st.wYear)][i]; + } + + res->tm_yday += st.wDay - 1; + res->tm_isdst = 0; + + return 0; +} - if (st.wYear < 1970) return NULL; +/********************************************************************* + * _gmtime64 (MSVCRT.@) + */ +struct MSVCRT_tm* CDECL MSVCRT__gmtime64(const MSVCRT___time64_t *secs) +{ + thread_data_t * const data = msvcrt_get_thread_data(); - data->time_buffer.tm_sec = st.wSecond; - data->time_buffer.tm_min = st.wMinute; - data->time_buffer.tm_hour = st.wHour; - data->time_buffer.tm_mday = st.wDay; - data->time_buffer.tm_year = st.wYear - 1900; - data->time_buffer.tm_mon = st.wMonth - 1; - data->time_buffer.tm_wday = st.wDayOfWeek; - for (i = data->time_buffer.tm_yday = 0; i < st.wMonth - 1; i++) { - data->time_buffer.tm_yday += MonthLengths[IsLeapYear(st.wYear)][i]; - } + if(MSVCRT__gmtime64_s(&data->time_buffer, secs)) + return NULL; + return &data->time_buffer; +} - data->time_buffer.tm_yday += st.wDay - 1; - data->time_buffer.tm_isdst = 0; +/********************************************************************* + * _gmtime32_s (MSVCRT.@) + */ +int CDECL MSVCRT__gmtime32_s(struct MSVCRT_tm *res, const MSVCRT___time32_t *secs) +{ + MSVCRT___time64_t secs64; - return &data->time_buffer; + if(secs) { + secs64 = *secs; + return MSVCRT__gmtime64_s(res, &secs64); + } + return MSVCRT__gmtime64_s(res, NULL); } /********************************************************************* @@ -270,7 +311,12 @@ struct MSVCRT_tm* CDECL MSVCRT__gmtime64(const MSVCRT___time64_t* secs) */ struct MSVCRT_tm* CDECL MSVCRT__gmtime32(const MSVCRT___time32_t* secs) { - MSVCRT___time64_t secs64 = *secs; + MSVCRT___time64_t secs64; + + if(!secs) + return NULL; + + secs64 = *secs; return MSVCRT__gmtime64( &secs64 ); }
1
0
0
0
Piotr Caban : msvcrt: Added _strdate_s and _wstrdate_s implementation.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: 471bad1ee805f2eb6c932ea0b1b57a3f78267061 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=471bad1ee805f2eb6c932ea0b…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 01:46:00 2010 +0200 msvcrt: Added _strdate_s and _wstrdate_s implementation. --- dlls/msvcr100/msvcr100.spec | 4 +- dlls/msvcr80/msvcr80.spec | 4 +- dlls/msvcr90/msvcr90.spec | 4 +- dlls/msvcrt/msvcrt.spec | 4 +- dlls/msvcrt/tests/time.c | 24 +++++++++++++++++++++++ dlls/msvcrt/time.c | 44 +++++++++++++++++++++++++++++++++++++++++++ include/msvcrt/time.h | 2 + include/msvcrt/wchar.h | 1 + 8 files changed, 79 insertions(+), 8 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index c9c248b..a6b8ec0 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1131,7 +1131,7 @@ @ stub _statusfp2 @ stub _strcoll_l @ cdecl _strdate(ptr) msvcrt._strdate -@ stub _strdate_s +@ cdecl _strdate_s(ptr long) msvcrt._strdate_s @ cdecl _strdup(str) msvcrt._strdup @ cdecl _strerror(long) msvcrt._strerror @ stub _strerror_s @@ -1398,7 +1398,7 @@ @ cdecl _wstat64(wstr ptr) msvcrt._wstat64 @ stub _wstat64i32 @ cdecl _wstrdate(ptr) msvcrt._wstrdate -@ stub _wstrdate_s +@ cdecl _wstrdate_s(ptr long) msvcrt._wstrdate_s @ cdecl _wstrtime(ptr) msvcrt._wstrtime @ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s @ cdecl _wsystem(wstr) msvcrt._wsystem diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index de58182..ae2a1f8 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -985,7 +985,7 @@ @ stub _statusfp2 @ stub _strcoll_l @ cdecl _strdate(ptr) msvcrt._strdate -@ stub _strdate_s +@ cdecl _strdate_s(ptr long) msvcrt._strdate_s @ cdecl _strdup(str) msvcrt._strdup @ cdecl _strerror(long) msvcrt._strerror @ stub _strerror_s @@ -1254,7 +1254,7 @@ @ cdecl _wstat64(wstr ptr) msvcrt._wstat64 @ stub _wstat64i32 @ cdecl _wstrdate(ptr) msvcrt._wstrdate -@ stub _wstrdate_s +@ cdecl _wstrdate_s(ptr long) msvcrt._wstrdate_s @ cdecl _wstrtime(ptr) msvcrt._wstrtime @ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s @ cdecl _wsystem(wstr) msvcrt._wsystem diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index b3f3801..7000c2d 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -971,7 +971,7 @@ @ stub _statusfp2 @ stub _strcoll_l @ cdecl _strdate(ptr) msvcrt._strdate -@ stub _strdate_s +@ cdecl _strdate_s(ptr long) msvcrt._strdate_s @ cdecl _strdup(str) msvcrt._strdup @ cdecl _strerror(long) msvcrt._strerror @ stub _strerror_s @@ -1238,7 +1238,7 @@ @ cdecl _wstat64(wstr ptr) msvcrt._wstat64 @ stub _wstat64i32 @ cdecl _wstrdate(ptr) msvcrt._wstrdate -@ stub _wstrdate_s +@ cdecl _wstrdate_s(ptr long) msvcrt._wstrdate_s @ cdecl _wstrtime(ptr) msvcrt._wstrtime @ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s @ cdecl _wsystem(wstr) msvcrt._wsystem diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 753ca7a..2ace243 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -906,7 +906,7 @@ @ cdecl _strcmpi(str str) ntdll._strcmpi # stub _strcoll_l @ cdecl _strdate(ptr) -# stub _strdate_s +@ cdecl _strdate_s(ptr long) @ cdecl _strdup(str) # stub _strdup_dbg @ cdecl _strerror(long) @@ -1168,7 +1168,7 @@ @ cdecl _wstati64(wstr ptr) MSVCRT__wstati64 @ cdecl _wstat64(wstr ptr) MSVCRT__wstat64 @ cdecl _wstrdate(ptr) -# stub _wstrdate_s +@ cdecl _wstrdate_s(ptr long) @ cdecl _wstrtime(ptr) @ cdecl _wstrtime_s(ptr long) @ cdecl _wsystem(wstr) diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 4dfeb64..78d8e09 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -36,6 +36,7 @@ static __time32_t (__cdecl *p_mkgmtime32)(struct tm*); static struct tm* (__cdecl *p_gmtime32)(__time32_t*); static errno_t (__cdecl *p_strtime_s)(char*,size_t); +static errno_t (__cdecl *p_strdate_s)(char*,size_t); static void init(void) { @@ -44,6 +45,7 @@ static void init(void) p_gmtime32 = (void*)GetProcAddress(hmod, "_gmtime32"); p_mkgmtime32 = (void*)GetProcAddress(hmod, "_mkgmtime32"); p_strtime_s = (void*)GetProcAddress(hmod, "_strtime_s"); + p_strdate_s = (void*)GetProcAddress(hmod, "_strdate_s"); } static int get_test_year(time_t *start) @@ -295,6 +297,7 @@ static void test_strdate(void) { char date[16], * result; int month, day, year, count, len; + errno_t err; result = _strdate(date); ok(result == date, "Wrong return value\n"); @@ -302,6 +305,27 @@ static void test_strdate(void) ok(len == 8, "Wrong length: returned %d, should be 8\n", len); count = sscanf(date, "%02d/%02d/%02d", &month, &day, &year); ok(count == 3, "Wrong format: count = %d, should be 3\n", count); + + if(!p_strdate_s) { + win_skip("Skipping _strdate_s tests\n"); + return; + } + + errno = 0; + err = p_strdate_s(NULL, 1); + ok(err == EINVAL, "err = %d\n", err); + ok(errno == EINVAL, "errno = %d\n", errno); + + date[0] = 'x'; + date[1] = 'x'; + err = p_strdate_s(date, 8); + ok(err == ERANGE, "err = %d\n", err); + ok(errno == ERANGE, "errno = %d\n", errno); + ok(date[0] == '\0', "date[0] != '\\0'\n"); + ok(date[1] == 'x', "date[1] != 'x'\n"); + + err = p_strdate_s(date, 9); + ok(err == 0, "err = %x\n", err); } static void test_strtime(void) diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index b0ad20d..5044203 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -302,6 +302,28 @@ char* CDECL _strdate(char* date) } /********************************************************************** + * _strdate_s (MSVCRT.@) + */ +int CDECL _strdate_s(char* date, MSVCRT_size_t size) +{ + if(date && size) + date[0] = '\0'; + + if(!date) { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + + if(size < 9) { + *MSVCRT__errno() = MSVCRT_ERANGE; + return MSVCRT_ERANGE; + } + + _strdate(date); + return 0; +} + +/********************************************************************** * _wstrdate (MSVCRT.@) */ MSVCRT_wchar_t* CDECL _wstrdate(MSVCRT_wchar_t* date) @@ -313,6 +335,28 @@ MSVCRT_wchar_t* CDECL _wstrdate(MSVCRT_wchar_t* date) return date; } +/********************************************************************** + * _wstrdate_s (MSVCRT.@) + */ +int CDECL _wstrdate_s(MSVCRT_wchar_t* date, MSVCRT_size_t size) +{ + if(date && size) + date[0] = '\0'; + + if(!date) { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + + if(size < 9) { + *MSVCRT__errno() = MSVCRT_ERANGE; + return MSVCRT_ERANGE; + } + + _wstrdate(date); + return 0; +} + /********************************************************************* * _strtime (MSVCRT.@) */ diff --git a/include/msvcrt/time.h b/include/msvcrt/time.h index 2175526..ebbfbc2 100644 --- a/include/msvcrt/time.h +++ b/include/msvcrt/time.h @@ -89,6 +89,7 @@ extern char *_tzname; unsigned __cdecl _getsystime(struct tm*); unsigned __cdecl _setsystime(struct tm*,unsigned); char* __cdecl _strdate(char*); +errno_t __cdecl _strdate_s(char*,size_t); char* __cdecl _strtime(char*); errno_t __cdecl _strtime_s(char*,size_t); void __cdecl _tzset(void); @@ -130,6 +131,7 @@ size_t __cdecl wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*); wchar_t* __cdecl _wctime32(const __time32_t*); wchar_t* __cdecl _wctime64(const __time64_t*); wchar_t* __cdecl _wstrdate(wchar_t*); +errno_t __cdecl _wstrdate_s(wchar_t*,size_t); wchar_t* __cdecl _wstrtime(wchar_t*); errno_t __cdecl _wstrtime_s(wchar_t*,size_t); diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h index c9b12fb..c5ab25f 100644 --- a/include/msvcrt/wchar.h +++ b/include/msvcrt/wchar.h @@ -396,6 +396,7 @@ size_t __cdecl wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*); wchar_t* __cdecl _wctime32(const __time32_t*); wchar_t* __cdecl _wctime64(const __time64_t*); wchar_t* __cdecl _wstrdate(wchar_t*); +errno_t __cdecl _wstrdate_s(wchar_t*,size_t); wchar_t* __cdecl _wstrtime(wchar_t*); errno_t __cdecl _wstrtime_s(wchar_t*,size_t);
1
0
0
0
Piotr Caban : msvcrt: Added _strtime_s and _wstrtime_s implementation.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: 7d0c04d31c1288ed38bb71afb3d054edf06849d2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d0c04d31c1288ed38bb71afb…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Aug 27 01:45:31 2010 +0200 msvcrt: Added _strtime_s and _wstrtime_s implementation. --- dlls/msvcr100/msvcr100.spec | 4 +- dlls/msvcr80/msvcr80.spec | 4 +- dlls/msvcr90/msvcr90.spec | 4 +- dlls/msvcrt/msvcrt.spec | 4 +- dlls/msvcrt/tests/time.c | 46 +++++++++++++++++++++++++++++++++++++----- dlls/msvcrt/time.c | 44 +++++++++++++++++++++++++++++++++++++++++ include/msvcrt/time.h | 2 + include/msvcrt/wchar.h | 1 + 8 files changed, 95 insertions(+), 14 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 771b2e0..c9c248b 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -1156,7 +1156,7 @@ @ cdecl _strset(str long) msvcrt._strset @ stub _strset_s @ cdecl _strtime(ptr) msvcrt._strtime -@ stub _strtime_s +@ cdecl _strtime_s(ptr long) msvcrt._strtime_s @ cdecl _strtod_l(str ptr ptr) msvcrt._strtod_l @ cdecl _strtoi64(str ptr long) msvcrt._strtoi64 @ cdecl _strtoi64_l(str ptr long ptr) msvcrt._strtoi64_l @@ -1400,7 +1400,7 @@ @ cdecl _wstrdate(ptr) msvcrt._wstrdate @ stub _wstrdate_s @ cdecl _wstrtime(ptr) msvcrt._wstrtime -@ stub _wstrtime_s +@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s @ cdecl _wsystem(wstr) msvcrt._wsystem @ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam @ stub _wtmpnam diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 02ba355..de58182 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -1010,7 +1010,7 @@ @ cdecl _strset(str long) msvcrt._strset @ stub _strset_s @ cdecl _strtime(ptr) msvcrt._strtime -@ stub _strtime_s +@ cdecl _strtime_s(ptr long) msvcrt._strtime_s @ cdecl _strtod_l(str ptr ptr) msvcrt._strtod_l @ cdecl _strtoi64(str ptr long) msvcrt._strtoi64 @ cdecl _strtoi64_l(str ptr long ptr) msvcrt._strtoi64_l @@ -1256,7 +1256,7 @@ @ cdecl _wstrdate(ptr) msvcrt._wstrdate @ stub _wstrdate_s @ cdecl _wstrtime(ptr) msvcrt._wstrtime -@ stub _wstrtime_s +@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s @ cdecl _wsystem(wstr) msvcrt._wsystem @ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam @ stub _wtmpnam diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index a5c50b1..b3f3801 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -996,7 +996,7 @@ @ cdecl _strset(str long) msvcrt._strset @ stub _strset_s @ cdecl _strtime(ptr) msvcrt._strtime -@ stub _strtime_s +@ cdecl _strtime_s(ptr long) msvcrt._strtime_s @ cdecl _strtod_l(str ptr ptr) msvcrt._strtod_l @ cdecl _strtoi64(str ptr long) msvcrt._strtoi64 @ cdecl _strtoi64_l(str ptr long ptr) msvcrt._strtoi64_l @@ -1240,7 +1240,7 @@ @ cdecl _wstrdate(ptr) msvcrt._wstrdate @ stub _wstrdate_s @ cdecl _wstrtime(ptr) msvcrt._wstrtime -@ stub _wstrtime_s +@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s @ cdecl _wsystem(wstr) msvcrt._wsystem @ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam @ stub _wtmpnam diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 254f967..753ca7a 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -931,7 +931,7 @@ @ cdecl _strset(str long) # stub _strset_s @ cdecl _strtime(ptr) -# stub _strtime_s +@ cdecl _strtime_s(ptr long) @ cdecl _strtod_l(str ptr ptr) MSVCRT_strtod_l @ cdecl _strtoi64(str ptr long) MSVCRT_strtoi64 @ cdecl _strtoi64_l(str ptr long ptr) MSVCRT_strtoi64_l @@ -1170,7 +1170,7 @@ @ cdecl _wstrdate(ptr) # stub _wstrdate_s @ cdecl _wstrtime(ptr) -# stub _wstrtime_s +@ cdecl _wstrtime_s(ptr long) @ cdecl _wsystem(wstr) @ cdecl _wtempnam(wstr wstr) # stub _wtempnam_dbg diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 7f0a80b..4dfeb64 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -25,6 +25,7 @@ #include <stdlib.h> /*setenv*/ #include <stdio.h> /*printf*/ +#include <errno.h> #define SECSPERDAY 86400 #define SECSPERHOUR 3600 @@ -32,6 +33,19 @@ #define MINSPERHOUR 60 #define HOURSPERDAY 24 +static __time32_t (__cdecl *p_mkgmtime32)(struct tm*); +static struct tm* (__cdecl *p_gmtime32)(__time32_t*); +static errno_t (__cdecl *p_strtime_s)(char*,size_t); + +static void init(void) +{ + HMODULE hmod = GetModuleHandleA("msvcrt.dll"); + + p_gmtime32 = (void*)GetProcAddress(hmod, "_gmtime32"); + p_mkgmtime32 = (void*)GetProcAddress(hmod, "_mkgmtime32"); + p_strtime_s = (void*)GetProcAddress(hmod, "_strtime_s"); +} + static int get_test_year(time_t *start) { time_t now = time(NULL); @@ -54,14 +68,9 @@ static void test_ctime(void) } static void test_gmtime(void) { - static __time32_t (__cdecl *p_mkgmtime32)(struct tm*); - static struct tm* (__cdecl *p_gmtime32)(__time32_t*); - - HMODULE hmod = GetModuleHandleA("msvcrt.dll"); __time32_t valid, gmt; struct tm* gmt_tm; - p_gmtime32 = (void*)GetProcAddress(hmod, "_gmtime32"); if(!p_gmtime32) { win_skip("Skipping _gmtime32 tests\n"); return; @@ -81,7 +90,6 @@ static void test_gmtime(void) gmt_tm->tm_year, gmt_tm->tm_mon, gmt_tm->tm_yday, gmt_tm->tm_mday, gmt_tm->tm_wday, gmt_tm->tm_hour, gmt_tm->tm_min, gmt_tm->tm_sec, gmt_tm->tm_isdst); - p_mkgmtime32 = (void*)GetProcAddress(hmod, "_mkgmtime32"); if(!p_mkgmtime32) { win_skip("Skipping _mkgmtime32 tests\n"); return; @@ -300,6 +308,7 @@ static void test_strtime(void) { char time[16], * result; int hour, minute, second, count, len; + errno_t err; result = _strtime(time); ok(result == time, "Wrong return value\n"); @@ -307,6 +316,29 @@ static void test_strtime(void) ok(len == 8, "Wrong length: returned %d, should be 8\n", len); count = sscanf(time, "%02d:%02d:%02d", &hour, &minute, &second); ok(count == 3, "Wrong format: count = %d, should be 3\n", count); + + if(!p_strtime_s) { + win_skip("Skipping _strtime_s tests\n"); + return; + } + + errno = 0; + err = p_strtime_s(NULL, 0); + ok(err == EINVAL, "err = %d\n", err); + ok(errno == EINVAL, "errno = %d\n", errno); + + err = p_strtime_s(NULL, 1); + ok(err == EINVAL, "err = %d\n", err); + ok(errno == EINVAL, "errno = %d\n", errno); + + time[0] = 'x'; + err = p_strtime_s(time, 8); + ok(err == ERANGE, "err = %d\n", err); + ok(errno == ERANGE, "errno = %d\n", errno); + ok(time[0] == '\0', "time[0] != '\\0'\n"); + + err = p_strtime_s(time, 9); + ok(err == 0, "err = %x\n", err); } static void test_wstrdate(void) @@ -339,6 +371,8 @@ static void test_wstrtime(void) START_TEST(time) { + init(); + test_ctime(); test_gmtime(); test_mktime(); diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 2e8828c..b0ad20d 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -326,6 +326,28 @@ char* CDECL _strtime(char* time) } /********************************************************************* + * _strtime_s (MSVCRT.@) + */ +int CDECL _strtime_s(char* time, MSVCRT_size_t size) +{ + if(time && size) + time[0] = '\0'; + + if(!time) { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + + if(size < 9) { + *MSVCRT__errno() = MSVCRT_ERANGE; + return MSVCRT_ERANGE; + } + + _strtime(time); + return 0; +} + +/********************************************************************* * _wstrtime (MSVCRT.@) */ MSVCRT_wchar_t* CDECL _wstrtime(MSVCRT_wchar_t* time) @@ -338,6 +360,28 @@ MSVCRT_wchar_t* CDECL _wstrtime(MSVCRT_wchar_t* time) } /********************************************************************* + * _wstrtime_s (MSVCRT.@) + */ +int CDECL _wstrtime_s(MSVCRT_wchar_t* time, MSVCRT_size_t size) +{ + if(time && size) + time[0] = '\0'; + + if(!time) { + *MSVCRT__errno() = MSVCRT_EINVAL; + return MSVCRT_EINVAL; + } + + if(size < 9) { + *MSVCRT__errno() = MSVCRT_ERANGE; + return MSVCRT_ERANGE; + } + + _wstrtime(time); + return 0; +} + +/********************************************************************* * clock (MSVCRT.@) */ MSVCRT_clock_t CDECL MSVCRT_clock(void) diff --git a/include/msvcrt/time.h b/include/msvcrt/time.h index 4c44c7b..2175526 100644 --- a/include/msvcrt/time.h +++ b/include/msvcrt/time.h @@ -90,6 +90,7 @@ unsigned __cdecl _getsystime(struct tm*); unsigned __cdecl _setsystime(struct tm*,unsigned); char* __cdecl _strdate(char*); char* __cdecl _strtime(char*); +errno_t __cdecl _strtime_s(char*,size_t); void __cdecl _tzset(void); char* __cdecl asctime(const struct tm*); @@ -130,6 +131,7 @@ wchar_t* __cdecl _wctime32(const __time32_t*); wchar_t* __cdecl _wctime64(const __time64_t*); wchar_t* __cdecl _wstrdate(wchar_t*); wchar_t* __cdecl _wstrtime(wchar_t*); +errno_t __cdecl _wstrtime_s(wchar_t*,size_t); #ifndef _USE_32BIT_TIME_T static inline wchar_t* _wctime(const time_t *t) { return _wctime64(t); } diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h index 41ff3ff..c9b12fb 100644 --- a/include/msvcrt/wchar.h +++ b/include/msvcrt/wchar.h @@ -397,6 +397,7 @@ wchar_t* __cdecl _wctime32(const __time32_t*); wchar_t* __cdecl _wctime64(const __time64_t*); wchar_t* __cdecl _wstrdate(wchar_t*); wchar_t* __cdecl _wstrtime(wchar_t*); +errno_t __cdecl _wstrtime_s(wchar_t*,size_t); #ifndef _USE_32BIT_TIME_T static inline wchar_t* _wctime(const time_t *t) { return _wctime64(t); }
1
0
0
0
Juan Lang : urlmon: Return failures from progress callback.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: 3fec8d9e050df22a3ab31edeea8c87ae2dc50bb9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3fec8d9e050df22a3ab31edee…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Aug 26 16:06:37 2010 -0700 urlmon: Return failures from progress callback. --- dlls/urlmon/download.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/urlmon/download.c b/dlls/urlmon/download.c index ebcb9c9..fee9606 100644 --- a/dlls/urlmon/download.c +++ b/dlls/urlmon/download.c @@ -119,22 +119,22 @@ static HRESULT WINAPI DownloadBSC_OnLowResource(IBindStatusCallback *iface, DWOR return E_NOTIMPL; } -static void on_progress(DownloadBSC *This, ULONG progress, ULONG progress_max, ULONG status_code, LPCWSTR status_text) +static HRESULT on_progress(DownloadBSC *This, ULONG progress, ULONG progress_max, ULONG status_code, LPCWSTR status_text) { HRESULT hres; if(!This->callback) - return; + return S_OK; hres = IBindStatusCallback_OnProgress(This->callback, progress, progress_max, status_code, status_text); - if(FAILED(hres)) - FIXME("OnProgress failed: %08x\n", hres); + return hres; } static HRESULT WINAPI DownloadBSC_OnProgress(IBindStatusCallback *iface, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText) { DownloadBSC *This = STATUSCLB_THIS(iface); + HRESULT hres = S_OK; TRACE("%p)->(%u %u %u %s)\n", This, ulProgress, ulProgressMax, ulStatusCode, debugstr_w(szStatusText)); @@ -146,11 +146,11 @@ static HRESULT WINAPI DownloadBSC_OnProgress(IBindStatusCallback *iface, ULONG u case BINDSTATUS_ENDDOWNLOADDATA: case BINDSTATUS_SENDINGREQUEST: case BINDSTATUS_MIMETYPEAVAILABLE: - on_progress(This, ulProgress, ulProgressMax, ulStatusCode, szStatusText); + hres = on_progress(This, ulProgress, ulProgressMax, ulStatusCode, szStatusText); break; case BINDSTATUS_CACHEFILENAMEAVAILABLE: - on_progress(This, ulProgress, ulProgressMax, ulStatusCode, szStatusText); + hres = on_progress(This, ulProgress, ulProgressMax, ulStatusCode, szStatusText); This->cache_file = heap_strdupW(szStatusText); break; @@ -161,7 +161,7 @@ static HRESULT WINAPI DownloadBSC_OnProgress(IBindStatusCallback *iface, ULONG u FIXME("Unsupported status %u\n", ulStatusCode); } - return S_OK; + return hres; } static HRESULT WINAPI DownloadBSC_OnStopBinding(IBindStatusCallback *iface,
1
0
0
0
Louis Lenders : wine.inf.in: Add registry key under HKLM\%CurrentVersion%\Policies\System.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: af60f4bb26683d39c14889217aa29716c1f5acf5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af60f4bb26683d39c14889217…
Author: Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> Date: Fri Aug 27 00:19:56 2010 +0200 wine.inf.in: Add registry key under HKLM\%CurrentVersion%\Policies\System. --- tools/wine.inf.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/wine.inf.in b/tools/wine.inf.in index 41c8820..df34402 100644 --- a/tools/wine.inf.in +++ b/tools/wine.inf.in @@ -448,7 +448,7 @@ HKLM,%CurrentVersion%\Explorer\AutoplayHandlers,,16 HKLM,%CurrentVersion%\Explorer\DriveIcons,,16 HKLM,%CurrentVersion%\Explorer\KindMap,,16 HKLM,%CurrentVersion%\Group Policy,,16 -HKLM,%CurrentVersion%\Policies,,16 +HKLM,%CurrentVersion%\Policies\System,"EnableLUA",0x10003,0 HKLM,%CurrentVersion%\PreviewHandlers,,16 HKLM,%CurrentVersion%\Setup,"BootDir",,"%30%" HKLM,%CurrentVersion%\Setup,"SharedDir",,"%25%"
1
0
0
0
Thomas Mullaly : urlmon: Improved support for opaque file URL paths.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: 144ddea3f9d127374931ec7c4840a5c7c3f31ad2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=144ddea3f9d127374931ec7c4…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Thu Aug 26 13:28:19 2010 -0400 urlmon: Improved support for opaque file URL paths. --- dlls/urlmon/tests/uri.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++- dlls/urlmon/uri.c | 53 ++++++++++++++++++++++++++-- 2 files changed, 137 insertions(+), 5 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 7a7bfb1..d6bff96 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -3945,6 +3945,90 @@ static const uri_properties uri_tests[] = { {URL_SCHEME_FILE,S_OK,FALSE}, {URLZONE_INVALID,E_NOTIMPL,FALSE} } + }, + /* The '\' are still converted to '/' even though it's an opaque file URI. */ + { "file:c:\\dir\\../..\\index.html", 0, S_OK, FALSE, + Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY + |Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME, FALSE, + { + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"file:c:/dir/../../index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {".html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"c:/dir/../../index.html",S_OK,FALSE}, + {"c:/dir/../../index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file:c:\\dir\\../..\\index.html",S_OK,FALSE}, + {"file",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {0,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_FILE,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } + }, + /* '/' are still converted to '\' even though it's an opaque URI. */ + { "file:c:/dir\\../..\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, + Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY + |Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME, FALSE, + { + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"file:c:\\dir\\..\\..\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {".html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"c:\\dir\\..\\..\\index.html",S_OK,FALSE}, + {"c:\\dir\\..\\..\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file:c:/dir\\../..\\index.html",S_OK,FALSE}, + {"file",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {0,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_FILE,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } + }, + /* Forbidden characters aren't percent encoded. */ + { "file:c:\\in^|dex.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, + Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY + |Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME, FALSE, + { + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"file:c:\\in^|dex.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {".html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"c:\\in^|dex.html",S_OK,FALSE}, + {"c:\\in^|dex.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file:c:\\in^|dex.html",S_OK,FALSE}, + {"file",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {0,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_FILE,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } } }; @@ -4006,7 +4090,10 @@ static const invalid_uri invalid_uri_tests[] = { {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE}, {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE}, {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE}, - {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE} + {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE}, + {"file:c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE}, + {"file:c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE}, + {"file:c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE} }; typedef struct _uri_equality { diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 3a728f5..e2bec70 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -224,6 +224,10 @@ static inline BOOL is_unc_path(const WCHAR *str) { return (str[0] == '\\' && str[0] == '\\'); } +static inline BOOL is_forbidden_dos_path_char(WCHAR val) { + return (val == '>' || val == '<' || val == '\"'); +} + /* A URI is implicitly a file path if it begins with * a drive letter (eg X:) or starts with "\\" (UNC path). */ @@ -1798,7 +1802,7 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f return FALSE; } else continue; - } else if((**ptr == '>' || **ptr == '<' || **ptr == '\"') && is_file && + } else if(is_forbidden_dos_path_char(**ptr) && is_file && (flags & Uri_CREATE_FILE_USE_DOS_PATH)) { /* File schemes with USE_DOS_PATH set aren't allowed to have * a '<' or '>' or '\"' appear in them. @@ -1849,9 +1853,13 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f * NOTE: * Windows allows invalid % encoded data to appear in opaque URI paths * for unknown scheme types. + * + * File schemes with USE_DOS_PATH set aren't allowed to have '<', '>', or '\"' + * appear in them. */ static BOOL parse_path_opaque(const WCHAR **ptr, parse_data *data, DWORD flags) { const BOOL known_scheme = data->scheme_type != URL_SCHEME_UNKNOWN; + const BOOL is_file = data->scheme_type == URL_SCHEME_FILE; data->path = *ptr; @@ -1863,6 +1871,11 @@ static BOOL parse_path_opaque(const WCHAR **ptr, parse_data *data, DWORD flags) return FALSE; } else continue; + } else if(is_forbidden_dos_path_char(**ptr) && is_file && + (flags & Uri_CREATE_FILE_USE_DOS_PATH)) { + *ptr = data->path; + data->path = NULL; + return FALSE; } ++(*ptr); @@ -2804,10 +2817,17 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri, * * 3) '\\' are changed to '/' for known scheme types * except for mailto schemes. + * + * 4) For file schemes, if USE_DOS_PATH is set all '/' + * are converted to backslashes. + * + * 5) For file schemes, if USE_DOS_PATH isn't set all '\' + * are converted to forward slashes. */ static BOOL canonicalize_path_opaque(const parse_data *data, Uri *uri, DWORD flags, BOOL computeOnly) { const WCHAR *ptr; const BOOL known_scheme = data->scheme_type != URL_SCHEME_UNKNOWN; + const BOOL is_file = data->scheme_type == URL_SCHEME_FILE; if(!data->path) { uri->path_start = -1; @@ -2846,11 +2866,36 @@ static BOOL canonicalize_path_opaque(const parse_data *data, Uri *uri, DWORD fla uri->canon_uri[uri->canon_len] = *ptr; ++uri->canon_len; } + } else if(*ptr == '/' && is_file && (flags & Uri_CREATE_FILE_USE_DOS_PATH)) { + if(!computeOnly) + uri->canon_uri[uri->canon_len] = '\\'; + ++uri->canon_len; + } else if(*ptr == '\\' && is_file) { + if(!(flags & Uri_CREATE_FILE_USE_DOS_PATH)) { + /* Convert to a '/'. */ + if(!computeOnly) + uri->canon_uri[uri->canon_len] = '/'; + ++uri->canon_len; + } else { + /* Just copy it over. */ + if(!computeOnly) + uri->canon_uri[uri->canon_len] = *ptr; + ++uri->canon_len; + } } else if(known_scheme && !is_unreserved(*ptr) && !is_reserved(*ptr) && !(flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS)) { - if(!computeOnly) - pct_encode_val(*ptr, uri->canon_uri+uri->canon_len); - uri->canon_len += 3; + if(is_file && (flags & Uri_CREATE_FILE_USE_DOS_PATH)) { + /* Forbidden characters aren't percent encoded for file schemes + * with USE_DOS_PATH set. + */ + if(!computeOnly) + uri->canon_uri[uri->canon_len] = *ptr; + ++uri->canon_len; + } else { + if(!computeOnly) + pct_encode_val(*ptr, uri->canon_uri+uri->canon_len); + uri->canon_len += 3; + } } else { if(!computeOnly) uri->canon_uri[uri->canon_len] = *ptr;
1
0
0
0
Thomas Mullaly : urlmon: Finished adding basic support for Uri_CREATE_FILE_USE_DOS_PATH.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: fe89d8ac5b408388eaa6badea13f76a109711b79 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fe89d8ac5b408388eaa6badea…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Wed Aug 25 21:59:30 2010 -0400 urlmon: Finished adding basic support for Uri_CREATE_FILE_USE_DOS_PATH. --- dlls/urlmon/tests/uri.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++- dlls/urlmon/uri.c | 34 ++++++++++++++++++------ 2 files changed, 87 insertions(+), 10 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 54f5ef4..7a7bfb1 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -3887,6 +3887,64 @@ static const uri_properties uri_tests[] = { {URL_SCHEME_UNKNOWN,S_OK,FALSE}, {URLZONE_INVALID,E_NOTIMPL,FALSE} } + }, + /* Dot segements aren't removed. */ + { "file://c:\\dir\\../..\\./index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH + |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE + |Uri_HAS_SCHEME, FALSE, + { + {"file://c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file://c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {".html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE}, + {"c:\\dir\\..\\..\\.\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file://c:\\dir\\../..\\./index.html",S_OK,FALSE}, + {"file",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {0,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_FILE,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } + }, + /* Forbidden characters aren't percent encoded. */ + { "file://c:\\dir\\i^|ndex.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH + |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE + |Uri_HAS_SCHEME, FALSE, + { + {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {".html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"c:\\dir\\i^|ndex.html",S_OK,FALSE}, + {"c:\\dir\\i^|ndex.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file://c:\\dir\\i^|ndex.html",S_OK,FALSE}, + {"file",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {0,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_FILE,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } } }; @@ -3945,7 +4003,10 @@ static const invalid_uri invalid_uri_tests[] = { /* Invalid % encoded data in fragment of know scheme type. */ {"
ftp://google.com/#Test%xx
",0,FALSE}, {"
http://google.com/
",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE}, - {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE} + {"\n\nhttp://google.com/",Uri_CREATE_NO_PRE_PROCESS_HTML_URI,FALSE}, + {"file://c:\\test<test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE}, + {"file://c:\\test>test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE}, + {"file://c:\\test\"test",Uri_CREATE_FILE_USE_DOS_PATH,FALSE} }; typedef struct _uri_equality { diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index f184aab..3a728f5 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -1776,6 +1776,7 @@ static BOOL parse_authority(const WCHAR **ptr, parse_data *data, DWORD flags) { static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD flags) { const WCHAR *start = *ptr; static const WCHAR slash[] = {'/',0}; + const BOOL is_file = data->scheme_type == URL_SCHEME_FILE; if(is_path_delim(**ptr)) { if(data->scheme_type == URL_SCHEME_WILDCARD) { @@ -1791,13 +1792,19 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f } } else { while(!is_path_delim(**ptr)) { - if(**ptr == '%' && data->scheme_type != URL_SCHEME_UNKNOWN && - data->scheme_type != URL_SCHEME_FILE) { + if(**ptr == '%' && data->scheme_type != URL_SCHEME_UNKNOWN && !is_file) { if(!check_pct_encoded(ptr)) { *ptr = start; return FALSE; } else continue; + } else if((**ptr == '>' || **ptr == '<' || **ptr == '\"') && is_file && + (flags & Uri_CREATE_FILE_USE_DOS_PATH)) { + /* File schemes with USE_DOS_PATH set aren't allowed to have + * a '<' or '>' or '\"' appear in them. + */ + *ptr = start; + return FALSE; } else if(**ptr == '\\') { /* Not allowed to have a backslash if NO_CANONICALIZE is set * and the scheme is known type (but not a file scheme). @@ -2742,10 +2749,17 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri, } } else if(known_scheme && !is_unreserved(*ptr) && !is_reserved(*ptr) && (!(flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS) || is_file)) { - /* Escape the forbidden character. */ - if(!computeOnly) - pct_encode_val(*ptr, uri->canon_uri+uri->canon_len); - uri->canon_len += 3; + if(is_file && (flags & Uri_CREATE_FILE_USE_DOS_PATH)) { + /* Don't escape the character. */ + if(!computeOnly) + uri->canon_uri[uri->canon_len] = *ptr; + ++uri->canon_len; + } else { + /* Escape the forbidden character. */ + if(!computeOnly) + pct_encode_val(*ptr, uri->canon_uri+uri->canon_len); + uri->canon_len += 3; + } } else { if(!computeOnly) uri->canon_uri[uri->canon_len] = *ptr; @@ -2756,10 +2770,12 @@ static BOOL canonicalize_path_hierarchical(const parse_data *data, Uri *uri, uri->path_len = uri->canon_len - uri->path_start; /* Removing the dot segments only happens when it's not in - * computeOnly mode and it's not a wildcard scheme. + * computeOnly mode and it's not a wildcard scheme. File schemes + * with USE_DOS_PATH set don't get dot segments removed. */ - if(!computeOnly && data->scheme_type != URL_SCHEME_WILDCARD) { - if(!(flags & Uri_CREATE_NO_CANONICALIZE)) { + if(!(is_file && (flags & Uri_CREATE_FILE_USE_DOS_PATH)) && + data->scheme_type != URL_SCHEME_WILDCARD) { + if(!(flags & Uri_CREATE_NO_CANONICALIZE) && !computeOnly) { /* Remove the dot segments (if any) and reset everything to the new * correct length. */
1
0
0
0
Thomas Mullaly : urlmon: Improved support for determining if a URI is hierarchical or not.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: 948009872dcd322c4eeeaa55da7e2117eafa13d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=948009872dcd322c4eeeaa55d…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Wed Aug 25 21:12:46 2010 -0400 urlmon: Improved support for determining if a URI is hierarchical or not. --- dlls/urlmon/tests/uri.c | 116 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/urlmon/uri.c | 44 ++++++++++++------ 2 files changed, 145 insertions(+), 15 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 11a464e..54f5ef4 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -3771,6 +3771,122 @@ static const uri_properties uri_tests[] = { {URL_SCHEME_FILE,S_OK,FALSE}, {URLZONE_INVALID,E_NOTIMPL,FALSE} } + }, + /* The backslashes after the scheme name are converted to forward slashes. */ + { "file:\\\\c:\\dir\\index.html", Uri_CREATE_FILE_USE_DOS_PATH, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH + |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE + |Uri_HAS_SCHEME, FALSE, + { + {"file://c:\\dir\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file://c:\\dir\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {".html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"c:\\dir\\index.html",S_OK,FALSE}, + {"c:\\dir\\index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file:\\\\c:\\dir\\index.html",S_OK,FALSE}, + {"file",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {0,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_FILE,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } + }, + { "file:\\\\c:/dir/index.html", 0, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH + |Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE + |Uri_HAS_SCHEME, FALSE, + { + {"file:///c:/dir/index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file:///c:/dir/index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {".html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"/c:/dir/index.html",S_OK,FALSE}, + {"/c:/dir/index.html",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"file:\\\\c:/dir/index.html",S_OK,FALSE}, + {"file",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {0,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_FILE,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } + }, + { "http:\\\\google.com", 0, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN| + Uri_HAS_HOST|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME| + Uri_HAS_HOST_TYPE|Uri_HAS_PORT|Uri_HAS_SCHEME, + FALSE, + { + {"
http://google.com/
",S_OK,FALSE}, + {"
google.com
",S_OK,FALSE}, + {"
http://google.com/
",S_OK,FALSE}, + {"
google.com
",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"
google.com
",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"/",S_OK,FALSE}, + {"/",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"http:\\\\google.com",S_OK,FALSE}, + {"http",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {Uri_HOST_DNS,S_OK,FALSE}, + {80,S_OK,FALSE}, + {URL_SCHEME_HTTP,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } + }, + /* the "\\\\" aren't converted to "//" for unknown scheme types and it's considered opaque. */ + { "
zip:\\\\google.com
", 0, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_EXTENSION|Uri_HAS_PATH| + Uri_HAS_PATH_AND_QUERY|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_SCHEME| + Uri_HAS_HOST_TYPE, + FALSE, + { + {"
zip:\\\\google.com
",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"
zip:\\\\google.com
",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {".com",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"\\\\google.com",S_OK,FALSE}, + {"\\\\google.com",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"
zip:\\\\google.com
",S_OK,FALSE}, + {"zip",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {Uri_HOST_UNKNOWN,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_UNKNOWN,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } } }; diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 530b1ad..f184aab 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -306,6 +306,33 @@ static inline BOOL is_hierarchical_scheme(URL_SCHEME type) { type == URL_SCHEME_RES); } +/* Determines if the URI is hierarchical using the information already parsed into + * data and using the current location of parsing in the URI string. + * + * Windows considers a URI hierarchical if on of the following is true: + * A.) It's a wildcard scheme. + * B.) It's an implicit file scheme. + * C.) It's a known hierarchical scheme and it has two '\\' after the scheme name. + * (the '\\' will be converted into "//" during canonicalization). + * D.) It's not a relative URI and "//" appears after the scheme name. + */ +static inline BOOL is_hierarchical_uri(const WCHAR **ptr, const parse_data *data) { + const WCHAR *start = *ptr; + + if(data->scheme_type == URL_SCHEME_WILDCARD) + return TRUE; + else if(data->scheme_type == URL_SCHEME_FILE && data->has_implicit_scheme) + return TRUE; + else if(is_hierarchical_scheme(data->scheme_type) && (*ptr)[0] == '\\' && (*ptr)[1] == '\\') { + *ptr += 2; + return TRUE; + } else if(!data->is_relative && check_hierarchical(ptr)) + return TRUE; + + *ptr = start; + return FALSE; +} + /* Checks if the two Uri's are logically equivalent. It's a simple * comparison, since they are both of type Uri, and it can access * the properties of each Uri directly without the need to go @@ -1866,17 +1893,8 @@ static BOOL parse_path_opaque(const WCHAR **ptr, parse_data *data, DWORD flags) static BOOL parse_hierpart(const WCHAR **ptr, parse_data *data, DWORD flags) { const WCHAR *start = *ptr; - /* Checks if the authority information needs to be parsed. - * - * Relative URI's aren't hierarchical URI's, but, they could trick - * "check_hierarchical" into thinking it is, so we need to explicitly - * make sure it's not relative. Also, if the URI is an implicit file - * scheme it might not contain a "//", but, it's considered hierarchical - * anyways. Wildcard Schemes are always considered hierarchical - */ - if(data->scheme_type == URL_SCHEME_WILDCARD || - (data->scheme_type == URL_SCHEME_FILE && is_implicit_file_path(*ptr)) || - (!data->is_relative && check_hierarchical(ptr))) { + /* Checks if the authority information needs to be parsed. */ + if(is_hierarchical_uri(ptr, data)) { /* Only treat it as a hierarchical URI if the scheme_type is known or * the Uri_CREATE_NO_CRACK_UNKNOWN_SCHEMES flag is not set. */ @@ -1885,10 +1903,6 @@ static BOOL parse_hierpart(const WCHAR **ptr, parse_data *data, DWORD flags) { TRACE("(%p %p %x): Treating URI as an hierarchical URI.\n", ptr, data, flags); data->is_opaque = FALSE; - if(data->scheme_type == URL_SCHEME_FILE) - /* Skip past the "//" after the scheme (if any). */ - check_hierarchical(ptr); - /* TODO: Handle hierarchical URI's, parse authority then parse the path. */ if(!parse_authority(ptr, data, flags)) return FALSE;
1
0
0
0
Thomas Mullaly : urlmon: Beginning to add support for Uri_CREATE_FILE_USE_DOS_PATH in CreateUri.
by Alexandre Julliard
27 Aug '10
27 Aug '10
Module: wine Branch: master Commit: 6a8b2d88af8ea2ab708c6a421f8d77ffced46316 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6a8b2d88af8ea2ab708c6a421…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Wed Aug 25 16:02:22 2010 -0400 urlmon: Beginning to add support for Uri_CREATE_FILE_USE_DOS_PATH in CreateUri. --- dlls/urlmon/tests/uri.c | 144 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/urlmon/uri.c | 70 +++++++++++++++++------ 2 files changed, 196 insertions(+), 18 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=6a8b2d88af8ea2ab708c6…
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
89
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
Results per page:
10
25
50
100
200