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
May
April
March
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-devel
April 2022
----- 2025 -----
May 2025
April 2025
March 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-devel@winehq.org
87 participants
938 discussions
Start a n
N
ew thread
[PATCH v4] include: Add some math declarations.
by Daniel Lehman
11 Apr '22
11 Apr '22
Signed-off-by: Daniel Lehman <dlehman25(a)gmail.com> --- v4: fix build using gcc without mingw v3: remove incorrect declarations and other unavailable functions v2: correct some declarations --- dlls/msvcrt/math.c | 20 ++++++++++---------- include/msvcrt/math.h | 32 +++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 854403a71bf..31200562f00 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/
…
[View More]
math.c @@ -8695,13 +8695,13 @@ __msvcrt_long CDECL lrintf(float x) /********************************************************************* * llrint (MSVCR120.@) */ -__int64 CDECL llrint(double x) +long long CDECL llrint(double x) { double d; d = rint(x); - if ((d < 0 && d != (double)(__int64)d) - || (d >= 0 && d != (double)(unsigned __int64)d)) { + if ((d < 0 && d != (double)(long long)d) + || (d >= 0 && d != (double)(unsigned long long)d)) { *_errno() = EDOM; return 0; } @@ -8711,13 +8711,13 @@ __int64 CDECL llrint(double x) /********************************************************************* * llrintf (MSVCR120.@) */ -__int64 CDECL llrintf(float x) +long long CDECL llrintf(float x) { float f; f = rintf(x); - if ((f < 0 && f != (float)(__int64)f) - || (f >= 0 && f != (float)(unsigned __int64)f)) { + if ((f < 0 && f != (float)(long long)f) + || (f >= 0 && f != (float)(unsigned long long)f)) { *_errno() = EDOM; return 0; } @@ -8798,10 +8798,10 @@ __msvcrt_long CDECL lroundf(float x) * * Copied from musl: src/math/llround.c */ -__int64 CDECL llround(double x) +long long CDECL llround(double x) { double d = round(x); - if (d != (double)(__int64)d) { + if (d != (double)(long long)d) { *_errno() = EDOM; return 0; } @@ -8813,10 +8813,10 @@ __int64 CDECL llround(double x) * * Copied from musl: src/math/llroundf.c */ -__int64 CDECL llroundf(float x) +long long CDECL llroundf(float x) { float f = roundf(x); - if (f != (float)(__int64)f) { + if (f != (float)(long long)f) { *_errno() = EDOM; return 0; } diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h index da07303bcd9..97ae6dfe240 100644 --- a/include/msvcrt/math.h +++ b/include/msvcrt/math.h @@ -69,12 +69,16 @@ _ACRTIMP double __cdecl fabs(double); _ACRTIMP double __cdecl ldexp(double, int); _ACRTIMP double __cdecl frexp(double, int*); _ACRTIMP double __cdecl modf(double, double*); +_ACRTIMP double __cdecl fdim(double, double); _ACRTIMP double __cdecl fmod(double, double); _ACRTIMP double __cdecl fmin(double, double); _ACRTIMP double __cdecl fmax(double, double); _ACRTIMP double __cdecl erf(double); +_ACRTIMP double __cdecl remainder(double, double); _ACRTIMP double __cdecl remquo(double, double, int*); _ACRTIMP float __cdecl remquof(float, float, int*); +_ACRTIMP double __cdecl lgamma(double); +_ACRTIMP double __cdecl tgamma(double); _ACRTIMP double __cdecl _hypot(double, double); _ACRTIMP double __cdecl _j0(double); @@ -86,18 +90,31 @@ _ACRTIMP double __cdecl _yn(int, double); _ACRTIMP double __cdecl cbrt(double); _ACRTIMP double __cdecl exp2(double); +_ACRTIMP double __cdecl expm1(double); +_ACRTIMP double __cdecl log1p(double); _ACRTIMP double __cdecl log2(double); +_ACRTIMP double __cdecl logb(double); _ACRTIMP double __cdecl rint(double); _ACRTIMP double __cdecl round(double); _ACRTIMP double __cdecl trunc(double); _ACRTIMP float __cdecl cbrtf(float); _ACRTIMP float __cdecl exp2f(float); +_ACRTIMP float __cdecl expm1f(float); +_ACRTIMP float __cdecl log1pf(float); _ACRTIMP float __cdecl log2f(float); +_ACRTIMP float __cdecl logbf(float); _ACRTIMP float __cdecl rintf(float); _ACRTIMP float __cdecl roundf(float); _ACRTIMP float __cdecl truncf(float); +_ACRTIMP int __cdecl ilogb(double); +_ACRTIMP int __cdecl ilogbf(float); + +_ACRTIMP long long __cdecl llrint(double); +_ACRTIMP long long __cdecl llrintf(float); +_ACRTIMP long long __cdecl llround(double); +_ACRTIMP long long __cdecl llroundf(float); _ACRTIMP __msvcrt_long __cdecl lrint(double); _ACRTIMP __msvcrt_long __cdecl lrintf(float); _ACRTIMP __msvcrt_long __cdecl lround(double); @@ -105,6 +122,8 @@ _ACRTIMP __msvcrt_long __cdecl lroundf(float); _ACRTIMP double __cdecl scalbn(double,int); _ACRTIMP float __cdecl scalbnf(float,int); +_ACRTIMP double __cdecl scalbln(double,__msvcrt_long); +_ACRTIMP float __cdecl scalblnf(float,__msvcrt_long); _ACRTIMP double __cdecl _copysign (double, double); _ACRTIMP double __cdecl _chgsign (double); @@ -115,6 +134,8 @@ _ACRTIMP int __cdecl _finite(double); _ACRTIMP int __cdecl _isnan(double); _ACRTIMP int __cdecl _fpclass(double); +_ACRTIMP double __cdecl nextafter(double, double); + #ifndef __i386__ _ACRTIMP float __cdecl sinf(float); @@ -199,15 +220,20 @@ _ACRTIMP float __cdecl _logbf(float); _ACRTIMP float __cdecl acoshf(float); _ACRTIMP float __cdecl asinhf(float); _ACRTIMP float __cdecl atanhf(float); +_ACRTIMP float __cdecl erff(float); +_ACRTIMP float __cdecl fdimf(float, float); +_ACRTIMP float __cdecl fmaxf(float, float); +_ACRTIMP float __cdecl fminf(float, float); +_ACRTIMP float __cdecl lgammaf(float); +_ACRTIMP float __cdecl nextafterf(float, float); +_ACRTIMP float __cdecl remainderf(float, float); +_ACRTIMP float __cdecl tgammaf(float); #else static inline float _chgsignf(float x) { return _chgsign(x); } static inline float _copysignf(float x, float y) { return _copysign(x, y); } static inline float _logbf(float x) { return _logb(x); } -static inline float acoshf(float x) { return acosh(x); } -static inline float asinhf(float x) { return asinh(x); } -static inline float atanhf(float x) { return atanh(x); } #endif -- 2.25.1
[View Less]
2
1
0
0
[PATCH v2 1/2] msvcp140: Implement _Copy_file().
by Paul Gofman
11 Apr '22
11 Apr '22
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> --- v2: - don't call SetLastError() on success. dlls/msvcp140/msvcp140.spec | 2 +- dlls/msvcp140/tests/msvcp140.c | 62 ++++++++++++++++++++++++++++++++++ dlls/msvcp90/ios.c | 11 ++++++ dlls/msvcp_win/msvcp_win.spec | 2 +- 4 files changed, 75 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 3de0318a4d5..e7bdcd0378e 100644 --- a/dlls/
…
[View More]
msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -3632,7 +3632,7 @@ @ cdecl _Cnd_timedwait(ptr ptr ptr) @ cdecl _Cnd_unregister_at_thread_exit(ptr) @ cdecl _Cnd_wait(ptr ptr) -@ stub _Copy_file +@ cdecl _Copy_file(wstr wstr) @ stub _Cosh @ cdecl _Current_get(ptr) @ cdecl _Current_set(wstr) tr2_sys__Current_set_wchar diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index 14ba4a767d0..423c4c652b9 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -227,6 +227,7 @@ static int (__cdecl *p__Xtime_diff_to_millis2)(const xtime*, const xtime*); static int (__cdecl *p_xtime_get)(xtime*, int); static void (__cdecl *p_Close_dir)(void*); +static DWORD (__cdecl *p_Copy_file)(WCHAR const *, WCHAR const *); static MSVCP_bool (__cdecl *p_Current_get)(WCHAR *); static MSVCP_bool (__cdecl *p_Current_set)(WCHAR const *); static int (__cdecl *p_Equivalent)(WCHAR const*, WCHAR const*); @@ -338,6 +339,7 @@ static BOOL init(void) SET(p_xtime_get, "xtime_get"); SET(p_Close_dir, "_Close_dir"); + SET(p_Copy_file, "_Copy_file"); SET(p_Current_get, "_Current_get"); SET(p_Current_set, "_Current_set"); SET(p_Equivalent, "_Equivalent"); @@ -1575,6 +1577,65 @@ static void test_cnd(void) CloseHandle(cm.initialized); } +static void test_Copy_file(void) +{ + WCHAR origin_path[MAX_PATH], temp_path[MAX_PATH]; + HANDLE file; + DWORD ret; + + GetCurrentDirectoryW(MAX_PATH, origin_path); + GetTempPathW(MAX_PATH, temp_path); + ok(SetCurrentDirectoryW(temp_path), "SetCurrentDirectoryW to temp_path failed\n"); + + CreateDirectoryW(L"wine_test_dir", NULL); + + file = CreateFileW(L"wine_test_dir/f1", 0, 0, NULL, CREATE_NEW, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(CloseHandle(file), "CloseHandle\n"); + + file = CreateFileW(L"wine_test_dir/f2", 0, 0, NULL, CREATE_NEW, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(CloseHandle(file), "CloseHandle\n"); + SetFileAttributesW(L"wine_test_dir/f2", FILE_ATTRIBUTE_READONLY); + + ok(CreateDirectoryW(L"wine_test_dir/d1", NULL) || GetLastError() == ERROR_ALREADY_EXISTS, + "CreateDirectoryW failed.\n"); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/f1", L"wine_test_dir/d1"); + ok(ret == ERROR_ACCESS_DENIED, "Got unexpected ret %lu.\n", ret); + ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/f1", L"wine_test_dir/f2"); + ok(ret == ERROR_ACCESS_DENIED, "Got unexpected ret %lu.\n", ret); + ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/f1", L"wine_test_dir/f3"); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %lu.\n", ret); + ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/f1", L"wine_test_dir/f3"); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %lu.\n", ret); + todo_wine ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/missing", L"wine_test_dir/f3"); + ok(ret == ERROR_FILE_NOT_FOUND, "Got unexpected ret %lu.\n", ret); + ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + ok(RemoveDirectoryW(L"wine_test_dir/d1"), "expect wine_test_dir to exist\n"); + ok(DeleteFileW(L"wine_test_dir/f1"), "expect wine_test_dir/f1 to exist\n"); + SetFileAttributesW(L"wine_test_dir/f2", FILE_ATTRIBUTE_NORMAL); + ok(DeleteFileW(L"wine_test_dir/f2"), "expect wine_test_dir/f2 to exist\n"); + ok(DeleteFileW(L"wine_test_dir/f3"), "expect wine_test_dir/f3 to exist\n"); + ok(RemoveDirectoryW(L"wine_test_dir"), "expect wine_test_dir to exist\n"); + + ok(SetCurrentDirectoryW(origin_path), "SetCurrentDirectoryW to origin_path failed\n"); +} + START_TEST(msvcp140) { if(!init()) return; @@ -1601,5 +1662,6 @@ START_TEST(msvcp140) test__Syserror_map(); test_Equivalent(); test_cnd(); + test_Copy_file(); FreeLibrary(msvcp); } diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index 61308f49203..ef2c122f17f 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -15776,6 +15776,17 @@ enum file_type __cdecl _Stat(WCHAR const* path, int* permissions) return (attr & FILE_ATTRIBUTE_DIRECTORY) ? directory_file : regular_file; } +/* _Copy_file, msvcp140 version */ +DWORD __cdecl _Copy_file(WCHAR const* src, WCHAR const* dst) +{ + TRACE("src %s, dst %s.\n", debugstr_w(src), debugstr_w(dst)); + + if (CopyFileW(src, dst, FALSE)) + return ERROR_SUCCESS; + + return GetLastError(); +} + /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z */ /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z */ enum file_type __cdecl tr2_sys__Lstat_wchar(WCHAR const* path, int* err_code) diff --git a/dlls/msvcp_win/msvcp_win.spec b/dlls/msvcp_win/msvcp_win.spec index a15fb5c7ee3..3ba0ce1dfba 100644 --- a/dlls/msvcp_win/msvcp_win.spec +++ b/dlls/msvcp_win/msvcp_win.spec @@ -3632,7 +3632,7 @@ @ cdecl _Cnd_timedwait(ptr ptr ptr) msvcp140._Cnd_timedwait @ cdecl _Cnd_unregister_at_thread_exit(ptr) msvcp140._Cnd_unregister_at_thread_exit @ cdecl _Cnd_wait(ptr ptr) msvcp140._Cnd_wait -@ stub _Copy_file +@ cdecl _Copy_file(wstr wstr) msvcp140._Copy_file @ stub _Cosh @ cdecl _Current_get(ptr) msvcp140._Current_get @ cdecl _Current_set(wstr) msvcp140._Current_set -- 2.35.1
[View Less]
2
2
0
0
[PATCH v2 1/6] urlmon: Add basic implementation of MapBrowserEmulationModeToUserAgent.
by Gabriel Ivăncescu
11 Apr '22
11 Apr '22
This is necessary for mshtml's navigator userAgent to work properly, since some apps expect it. The second argument seems to be output pointer that gets allocated (by CoTaskMemAlloc, or something compatible with it), but the first argument seems to be a pointer to an unknown struct, which makes it almost impossible to guess reliably what it does by just inspecting its behavior... Thankfully, it seems only the first DWORD field is necessary for this. Changing it returns the user agent for that
…
[View More]
given mode, if the rest is zeros. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/urlmon/session.c | 40 +++++++++++++++++++++++++++ dlls/urlmon/tests/misc.c | 57 +++++++++++++++++++++++++++++++++++++++ dlls/urlmon/urlmon.spec | 2 +- dlls/urlmon/urlmon_main.c | 10 ------- 4 files changed, 98 insertions(+), 11 deletions(-) diff --git a/dlls/urlmon/session.c b/dlls/urlmon/session.c index 052444d..e5dd26c 100644 --- a/dlls/urlmon/session.c +++ b/dlls/urlmon/session.c @@ -504,6 +504,7 @@ static BOOL get_url_encoding(HKEY root, DWORD *encoding) } static LPWSTR user_agent; +static BOOL user_agent_set; static size_t obtain_user_agent(unsigned int version, WCHAR *ret, size_t size) { @@ -710,6 +711,7 @@ HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID pBuffer, DWORD dwBuf heap_free(user_agent); user_agent = new_user_agent; + user_agent_set = TRUE; update_user_agent(user_agent); LeaveCriticalSection(&session_cs); @@ -748,6 +750,44 @@ HRESULT WINAPI ObtainUserAgentString(DWORD option, char *ret, DWORD *ret_size) return hres; } +/*********************************************************************** + * MapBrowserEmulationModeToUserAgent (URLMON.445) + * Undocumented, added in IE8 + */ +HRESULT WINAPI MapBrowserEmulationModeToUserAgent(const void *arg, WCHAR **ret) +{ + DWORD size, version; + const WCHAR *ua; + WCHAR buf[1024]; + + TRACE("%p %p: semi-stub\n", arg, ret); + + if(user_agent_set) { + /* Native ignores first arg if custom user agent has been set, doesn't crash even if NULL */ + size = (wcslen(user_agent) + 1) * sizeof(WCHAR); + ua = user_agent; + }else { + *ret = NULL; + + /* First arg seems to be a pointer to a structure of unknown size, and crashes + if it's too small (or filled with arbitrary values from the stack). For our + purposes, we only check first field which seems to be the requested version. */ + version = *(DWORD*)arg; + if(version == 5) + version = 7; + if(version < 7 || version > 11) + return E_FAIL; + + size = obtain_user_agent(version, buf, ARRAY_SIZE(buf)) * sizeof(WCHAR); + ua = buf; + } + + if(!(*ret = CoTaskMemAlloc(size))) + return E_OUTOFMEMORY; + memcpy(*ret, ua, size); + return S_OK; +} + void free_session(void) { name_space *ns_iter, *ns_last; diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c index 0575a43..c67b1d5 100644 --- a/dlls/urlmon/tests/misc.c +++ b/dlls/urlmon/tests/misc.c @@ -83,6 +83,7 @@ static HRESULT (WINAPI *pCompareSecurityIds)(BYTE*,DWORD,BYTE*,DWORD,DWORD); static HRESULT (WINAPI *pCoInternetIsFeatureEnabled)(INTERNETFEATURELIST,DWORD); static HRESULT (WINAPI *pCoInternetSetFeatureEnabled)(INTERNETFEATURELIST,DWORD,BOOL); static HRESULT (WINAPI *pIEInstallScope)(DWORD*); +static HRESULT (WINAPI *pMapBrowserEmulationModeToUserAgent)(const void*,WCHAR**); static WCHAR *a2co(const char *str) { @@ -2721,6 +2722,59 @@ static void test_bsc_marshaling(void) TerminateThread(thread, 0); } +static void test_MapBrowserEmulationModeToUserAgent(BOOL custom_ua) +{ + /* Undocumented structure of unknown size, crashes if it's too small (with arbitrary values from stack) */ + struct + { + DWORD version; + char unknown[252]; + } arg; + static char test_str[] = "test"; + const char *custom_ua_msg = ""; + HRESULT hres; + unsigned i; + WCHAR *ua; + + if(!pMapBrowserEmulationModeToUserAgent) { + win_skip("MapBrowserEmulationModeToUserAgent not available\n"); + return; + } + memset(&arg, 0, sizeof(arg)); + + if(custom_ua) { + hres = UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, test_str, sizeof(test_str), 0); + ok(hres == S_OK, "UrlMkSetSessionOption failed: %08lx\n", hres); + custom_ua_msg = " (with custom ua)"; + } + + for(i = 0; i < 12; i++) { + arg.version = i; + ua = (WCHAR*)0xdeadbeef; + hres = pMapBrowserEmulationModeToUserAgent(&arg, &ua); + ok(hres == (i == 5 || i >= 7 || custom_ua ? S_OK : E_FAIL), + "[%u] MapBrowserEmulationModeToUserAgent%s returned %08lx\n", i, custom_ua_msg, hres); + if(hres != S_OK) + ok(ua == NULL, "[%u] ua%s = %p\n", i, custom_ua_msg, ua); + else { + char buf[1024]; + DWORD size = sizeof(buf); + WCHAR *ua2; + + if(custom_ua) + ua2 = a2co(test_str); + else { + hres = pObtainUserAgentString(i, buf, &size); + ok(hres == S_OK, "[%u] ObtainUserAgentString%s failed: %08lx\n", i, custom_ua_msg, hres); + ua2 = a2co(buf); + } + ok(!lstrcmpW(ua, ua2), "[%u] ua%s = %s, expected %s\n", i, custom_ua_msg, wine_dbgstr_w(ua), wine_dbgstr_w(ua2)); + CoTaskMemFree(ua2); + CoTaskMemFree(ua); + } + } +} + START_TEST(misc) { HMODULE hurlmon; @@ -2745,6 +2799,7 @@ START_TEST(misc) pCoInternetIsFeatureEnabled = (void*) GetProcAddress(hurlmon, "CoInternetIsFeatureEnabled"); pCoInternetSetFeatureEnabled = (void*) GetProcAddress(hurlmon, "CoInternetSetFeatureEnabled"); pIEInstallScope = (void*) GetProcAddress(hurlmon, "IEInstallScope"); + pMapBrowserEmulationModeToUserAgent = (void*) GetProcAddress(hurlmon, (const char*)445); if (!pCoInternetCompareUrl || !pCoInternetGetSecurityUrl || !pCoInternetGetSession || !pCoInternetParseUrl || !pCompareSecurityIds) { @@ -2757,6 +2812,7 @@ START_TEST(misc) if(argc <= 2 || strcmp(argv[2], "internet_features")) { register_protocols(); + test_MapBrowserEmulationModeToUserAgent(FALSE); test_CreateFormatEnum(); test_RegisterFormatEnumerator(); test_CoInternetParseUrl(); @@ -2773,6 +2829,7 @@ START_TEST(misc) test_MkParseDisplayNameEx(); test_IsValidURL(); test_bsc_marshaling(); + test_MapBrowserEmulationModeToUserAgent(TRUE); } test_internet_features(); diff --git a/dlls/urlmon/urlmon.spec b/dlls/urlmon/urlmon.spec index ea3cd38..2fda69e 100644 --- a/dlls/urlmon/urlmon.spec +++ b/dlls/urlmon/urlmon.spec @@ -110,6 +110,6 @@ 410 stdcall @(long long) LogSqmBits 423 stdcall @(long long long long) LogSqmUXCommandOffsetInternal 444 stdcall @(long long long) MapUriToBrowserEmulationState -445 stdcall @(long long) MapBrowserEmulationModeToUserAgent +445 stdcall @(ptr ptr) MapBrowserEmulationModeToUserAgent 446 stdcall @(long) CoInternetGetBrowserProfile 455 stdcall @() FlushUrlmonZonesCache diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c index b540313..56c2257 100644 --- a/dlls/urlmon/urlmon_main.c +++ b/dlls/urlmon/urlmon_main.c @@ -791,16 +791,6 @@ int WINAPI MapUriToBrowserEmulationState(DWORD unk1, DWORD unk2, DWORD unk3) return 0; } -/*********************************************************************** - * MapBrowserEmulationModeToUserAgent (URLMON.445) - * Undocumented, added in IE8 - */ -int WINAPI MapBrowserEmulationModeToUserAgent(DWORD unk1, DWORD unk2) -{ - FIXME("stub: %ld %ld\n", unk1, unk2); - return 0; -} - /*********************************************************************** * CoInternetGetBrowserProfile (URLMON.446) * Undocumented, added in IE8 -- 2.34.1
[View Less]
3
13
0
0
[PATCH] msvcp140: Implement _Copy_file().
by Paul Gofman
11 Apr '22
11 Apr '22
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> --- dlls/msvcp140/msvcp140.spec | 2 +- dlls/msvcp140/tests/msvcp140.c | 62 ++++++++++++++++++++++++++++++++++ dlls/msvcp90/ios.c | 13 +++++++ dlls/msvcp_win/msvcp_win.spec | 2 +- 4 files changed, 77 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index 3de0318a4d5..e7bdcd0378e 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -3632,
…
[View More]
7 +3632,7 @@ @ cdecl _Cnd_timedwait(ptr ptr ptr) @ cdecl _Cnd_unregister_at_thread_exit(ptr) @ cdecl _Cnd_wait(ptr ptr) -@ stub _Copy_file +@ cdecl _Copy_file(wstr wstr) @ stub _Cosh @ cdecl _Current_get(ptr) @ cdecl _Current_set(wstr) tr2_sys__Current_set_wchar diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index 14ba4a767d0..1df2f058424 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -227,6 +227,7 @@ static int (__cdecl *p__Xtime_diff_to_millis2)(const xtime*, const xtime*); static int (__cdecl *p_xtime_get)(xtime*, int); static void (__cdecl *p_Close_dir)(void*); +static DWORD (__cdecl *p_Copy_file)(WCHAR const *, WCHAR const *); static MSVCP_bool (__cdecl *p_Current_get)(WCHAR *); static MSVCP_bool (__cdecl *p_Current_set)(WCHAR const *); static int (__cdecl *p_Equivalent)(WCHAR const*, WCHAR const*); @@ -338,6 +339,7 @@ static BOOL init(void) SET(p_xtime_get, "xtime_get"); SET(p_Close_dir, "_Close_dir"); + SET(p_Copy_file, "_Copy_file"); SET(p_Current_get, "_Current_get"); SET(p_Current_set, "_Current_set"); SET(p_Equivalent, "_Equivalent"); @@ -1575,6 +1577,65 @@ static void test_cnd(void) CloseHandle(cm.initialized); } +static void test_Copy_file(void) +{ + WCHAR origin_path[MAX_PATH], temp_path[MAX_PATH]; + HANDLE file; + DWORD ret; + + GetCurrentDirectoryW(MAX_PATH, origin_path); + GetTempPathW(MAX_PATH, temp_path); + ok(SetCurrentDirectoryW(temp_path), "SetCurrentDirectoryW to temp_path failed\n"); + + CreateDirectoryW(L"wine_test_dir", NULL); + + file = CreateFileW(L"wine_test_dir/f1", 0, 0, NULL, CREATE_NEW, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(CloseHandle(file), "CloseHandle\n"); + + file = CreateFileW(L"wine_test_dir/f2", 0, 0, NULL, CREATE_NEW, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(CloseHandle(file), "CloseHandle\n"); + SetFileAttributesW(L"wine_test_dir/f2", FILE_ATTRIBUTE_READONLY); + + ok(CreateDirectoryW(L"wine_test_dir/d1", NULL) || GetLastError() == ERROR_ALREADY_EXISTS, + "CreateDirectoryW failed.\n"); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/f1", L"wine_test_dir/d1"); + ok(ret == ERROR_ACCESS_DENIED, "Got unexpected ret %lu.\n", ret); + ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/f1", L"wine_test_dir/f2"); + ok(ret == ERROR_ACCESS_DENIED, "Got unexpected ret %lu.\n", ret); + ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/f1", L"wine_test_dir/f3"); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %lu.\n", ret); + ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/f1", L"wine_test_dir/f3"); + ok(ret == ERROR_SUCCESS, "Got unexpected ret %lu.\n", ret); + ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = p_Copy_file(L"wine_test_dir/missing", L"wine_test_dir/f3"); + ok(ret == ERROR_FILE_NOT_FOUND, "Got unexpected ret %lu.\n", ret); + ok(GetLastError() == ret, "Got unexpected err %lu.\n", GetLastError()); + + ok(RemoveDirectoryW(L"wine_test_dir/d1"), "expect wine_test_dir to exist\n"); + ok(DeleteFileW(L"wine_test_dir/f1"), "expect wine_test_dir/f1 to exist\n"); + SetFileAttributesW(L"wine_test_dir/f2", FILE_ATTRIBUTE_NORMAL); + ok(DeleteFileW(L"wine_test_dir/f2"), "expect wine_test_dir/f2 to exist\n"); + ok(DeleteFileW(L"wine_test_dir/f3"), "expect wine_test_dir/f3 to exist\n"); + ok(RemoveDirectoryW(L"wine_test_dir"), "expect wine_test_dir to exist\n"); + + ok(SetCurrentDirectoryW(origin_path), "SetCurrentDirectoryW to origin_path failed\n"); +} + START_TEST(msvcp140) { if(!init()) return; @@ -1601,5 +1662,6 @@ START_TEST(msvcp140) test__Syserror_map(); test_Equivalent(); test_cnd(); + test_Copy_file(); FreeLibrary(msvcp); } diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index 61308f49203..34d05608047 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -15776,6 +15776,19 @@ enum file_type __cdecl _Stat(WCHAR const* path, int* permissions) return (attr & FILE_ATTRIBUTE_DIRECTORY) ? directory_file : regular_file; } +/* _Copy_file, msvcp140 version */ +DWORD __cdecl _Copy_file(WCHAR const* src, WCHAR const* dst) +{ + TRACE("src %s, dst %s.\n", debugstr_w(src), debugstr_w(dst)); + + if (CopyFileW(src, dst, FALSE)) + { + SetLastError(ERROR_SUCCESS); + return ERROR_SUCCESS; + } + return GetLastError(); +} + /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z */ /* ?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z */ enum file_type __cdecl tr2_sys__Lstat_wchar(WCHAR const* path, int* err_code) diff --git a/dlls/msvcp_win/msvcp_win.spec b/dlls/msvcp_win/msvcp_win.spec index a15fb5c7ee3..3ba0ce1dfba 100644 --- a/dlls/msvcp_win/msvcp_win.spec +++ b/dlls/msvcp_win/msvcp_win.spec @@ -3632,7 +3632,7 @@ @ cdecl _Cnd_timedwait(ptr ptr ptr) msvcp140._Cnd_timedwait @ cdecl _Cnd_unregister_at_thread_exit(ptr) msvcp140._Cnd_unregister_at_thread_exit @ cdecl _Cnd_wait(ptr ptr) msvcp140._Cnd_wait -@ stub _Copy_file +@ cdecl _Copy_file(wstr wstr) msvcp140._Copy_file @ stub _Cosh @ cdecl _Current_get(ptr) msvcp140._Current_get @ cdecl _Current_set(wstr) msvcp140._Current_set -- 2.35.1
[View Less]
2
1
0
0
[PATCH 1/2] msvcr110: Add _Cancellation_beacon::_Cancellation_beacon_ctor stub.
by Torge Matthies
11 Apr '22
11 Apr '22
The pointer is needed for Crazy Machines 3 to not crash. Signed-off-by: Torge Matthies <tmatthies(a)codeweavers.com> --- dlls/msvcr110/msvcr110.spec | 2 +- dlls/msvcr120/msvcr120.spec | 2 +- dlls/msvcr120_app/msvcr120_app.spec | 2 +- dlls/msvcrt/concurrency.c | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 64c015b8ab6..b77671602ea 100644 --- a/dlls/
…
[View More]
msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -19,7 +19,7 @@ @ stub -arch=win64 ??0_CancellationTokenState@details@Concurrency@@AEAA@XZ @ stub -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ @ stub -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ +@ cdecl -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ(ptr) _Cancellation_beacon_ctor @ cdecl -arch=arm ??0_Condition_variable@details@Concurrency@@QAA@XZ(ptr) _Condition_variable_ctor @ thiscall -arch=i386 ??0_Condition_variable@details@Concurrency@@QAE@XZ(ptr) _Condition_variable_ctor @ cdecl -arch=win64 ??0_Condition_variable@details@Concurrency@@QEAA@XZ(ptr) _Condition_variable_ctor diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 8a5d20036ec..4d54227fd52 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -16,7 +16,7 @@ @ cdecl -arch=win64 ??0SchedulerPolicy@Concurrency@@QEAA@XZ(ptr) SchedulerPolicy_ctor @ stub -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ @ stub -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ +@ cdecl -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ(ptr) _Cancellation_beacon_ctor @ cdecl -arch=arm ??0_Condition_variable@details@Concurrency@@QAA@XZ(ptr) _Condition_variable_ctor @ thiscall -arch=i386 ??0_Condition_variable@details@Concurrency@@QAE@XZ(ptr) _Condition_variable_ctor @ cdecl -arch=win64 ??0_Condition_variable@details@Concurrency@@QEAA@XZ(ptr) _Condition_variable_ctor diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 2bf4a5010f8..3bb28baa631 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -14,7 +14,7 @@ @ cdecl -arch=win64 ??0SchedulerPolicy@Concurrency@@QEAA@XZ(ptr) msvcr120.??0SchedulerPolicy@Concurrency@@QEAA@XZ @ stub -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ @ stub -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ +@ cdecl -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ(ptr) msvcr120.??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ @ cdecl -arch=arm ??0_Condition_variable@details@Concurrency@@QAA@XZ(ptr) msvcr120.??0_Condition_variable@details@Concurrency@@QAA@XZ @ thiscall -arch=i386 ??0_Condition_variable@details@Concurrency@@QAE@XZ(ptr) msvcr120.??0_Condition_variable@details@Concurrency@@QAE@XZ @ cdecl -arch=win64 ??0_Condition_variable@details@Concurrency@@QEAA@XZ(ptr) msvcr120.??0_Condition_variable@details@Concurrency@@QEAA@XZ diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index 98baf253adf..0f9d0141f4c 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -308,6 +308,10 @@ typedef struct cv_queue { LONG expired; } cv_queue; +typedef struct { + void *unknown; +} _Cancellation_beacon; + typedef struct { /* cv_queue structure is not binary compatible */ cv_queue *queue; @@ -2486,6 +2490,21 @@ int __cdecl event_wait_for_multiple(event **events, size_t count, bool wait_all, #if _MSVCR_VER >= 110 +struct { + void *unk; +} _Cancellation_beacon_unknown = { + 0x0 +}; + +/* ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ */ +DEFINE_THISCALL_WRAPPER(_Cancellation_beacon_ctor, 4) +_Cancellation_beacon* __thiscall _Cancellation_beacon_ctor(_Cancellation_beacon *this) +{ + FIXME("(%p): stub!\n", this); + this->unknown = &_Cancellation_beacon_unknown; + return this; +} + /* ??0_Condition_variable@details@Concurrency@@QAE@XZ */ /* ??0_Condition_variable@details@Concurrency@@QEAA@XZ */ DEFINE_THISCALL_WRAPPER(_Condition_variable_ctor, 4) -- 2.35.1
[View Less]
1
1
0
0
[PATCH] po: Update German translation.
by Julian Rüger
11 Apr '22
11 Apr '22
Signed-off-by: Julian Rüger <jr98(a)gmx.net>
1
0
0
0
[PATCH v3 1/7] jscript: Implement Object.prototype.__defineGetter__.
by Gabriel Ivăncescu
11 Apr '22
11 Apr '22
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- dlls/jscript/object.c | 44 ++++++++++++++++ dlls/mshtml/tests/documentmode.js | 88 +++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+) diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index 9d4a747..d7650ff 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -294,6 +294,49 @@ done: return hres; } +static HRESULT Object_defineGetter(script_ctx_t *ctx, jsval_t
…
[View More]
vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) +{ + property_desc_t desc; + const WCHAR *name; + jsstr_t *name_str; + jsdisp_t *jsthis; + HRESULT hres; + + TRACE("\n"); + + if(!is_object_instance(vthis) || !(jsthis = to_jsdisp(get_object(vthis)))) + goto done; + + if(argc < 2 || !is_object_instance(argv[1])) + return JS_E_FUNCTION_EXPECTED; + + desc.getter = to_jsdisp(get_object(argv[1])); + if(!desc.getter) { + FIXME("getter is not JS object\n"); + return E_NOTIMPL; + } + /* FIXME: Check IsCallable */ + + hres = to_flat_string(ctx, argv[0], &name_str, &name); + if(FAILED(hres)) + return hres; + + desc.flags = desc.mask = PROPF_CONFIGURABLE | PROPF_ENUMERABLE; + desc.explicit_getter = TRUE; + desc.explicit_setter = FALSE; + desc.explicit_value = FALSE; + desc.setter = NULL; + hres = jsdisp_define_property(jsthis, name, &desc); + + jsstr_release(name_str); + if(FAILED(hres)) + return hres; +done: + if(r) + *r = jsval_undefined(); + return S_OK; +} + HRESULT Object_get_proto_(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { jsdisp_t *jsthis; @@ -365,6 +408,7 @@ static void Object_destructor(jsdisp_t *dispex) } static const builtin_prop_t Object_props[] = { + {L"__defineGetter__", Object_defineGetter, PROPF_METHOD|PROPF_ES6|2}, {L"hasOwnProperty", Object_hasOwnProperty, PROPF_METHOD|1}, {L"isPrototypeOf", Object_isPrototypeOf, PROPF_METHOD|1}, {L"propertyIsEnumerable", Object_propertyIsEnumerable, PROPF_METHOD|1}, diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 2902902..18dd65e 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -1415,6 +1415,94 @@ sync_test("__proto__", function() { } }); +sync_test("__defineGetter__", function() { + var v = document.documentMode; + var r, x = 42; + + if(v < 11) { + ok(x.__defineGetter__ === undefined, "x.__defineGetter__ = " + x.__defineGetter__); + ok(!("__defineGetter__" in Object), "Object.__defineGetter__ = " + Object.__defineGetter__); + return; + } + ok(Object.prototype.hasOwnProperty("__defineGetter__"), "__defineGetter__ is not a property of Object.prototype"); + ok(Object.prototype.__defineGetter__.length === 2, "__defineGetter__.length = " + Object.prototype.__defineGetter__.length); + + function getter() { return "wine"; } + function setter(val) { } + + r = x.__defineGetter__("foo", getter); + ok(r === undefined, "__defineGetter__ on 42 returned " + r); + ok(x.foo === undefined, "42.foo = " + x.foo); + + x = {}; + r = x.__defineGetter__("foo", getter); + ok(r === undefined, "__defineGetter__ returned " + r); + ok(x.foo === "wine", "x.foo = " + x.foo); + r = Object.getOwnPropertyDescriptor(x, "foo"); + ok(r.value === undefined, "x.foo value = " + r.value); + ok(r.get === getter, "x.foo get = " + r.get); + ok(r.set === undefined, "x.foo set = " + r.set); + ok(r.writable === undefined, "x.foo writable = " + r.writable); + ok(r.enumerable === true, "x.foo enumerable = " + r.enumerable); + ok(r.configurable === true, "x.foo configurable = " + r.configurable); + + Object.defineProperty(x, "foo", { get: undefined, set: setter, configurable: false }); + r = Object.getOwnPropertyDescriptor(x, "foo"); + ok(r.value === undefined, "x.foo setter value = " + r.value); + ok(r.get === undefined, "x.foo setter get = " + r.get); + ok(r.set === setter, "x.foo setter set = " + r.set); + ok(r.writable === undefined, "x.foo setter writable = " + r.writable); + ok(r.enumerable === true, "x.foo setter enumerable = " + r.enumerable); + ok(r.configurable === false, "x.foo setter configurable = " + r.configurable); + try { + x.__defineGetter__("foo", getter); + ok(false, "expected exception calling __defineGetter__ on non-configurable property"); + }catch(e) { + ok(e.number === 0xa13d6 - 0x80000000, "__defineGetter__ on non-configurable property threw exception " + e.number); + } + + r = Object.prototype.__defineGetter__.call(undefined, "bar", getter); + ok(r === undefined, "__defineGetter__ on undefined returned " + r); + r = Object.prototype.__defineGetter__.call(null, "bar", getter); + ok(r === undefined, "__defineGetter__ on null returned " + r); + r = x.__defineGetter__(undefined, getter); + ok(r === undefined, "__defineGetter__ undefined prop returned " + r); + ok(x["undefined"] === "wine", "x.undefined = " + x["undefined"]); + r = x.__defineGetter__(false, getter); + ok(r === undefined, "__defineGetter__ undefined prop returned " + r); + ok(x["false"] === "wine", "x.false = " + x["false"]); + + try { + x.__defineGetter__("bar", "string"); + ok(false, "expected exception calling __defineGetter__ with string"); + }catch(e) { + ok(e.number === 0xa138a - 0x80000000, "__defineGetter__ with string threw exception " + e.number); + } + try { + x.__defineGetter__("bar", undefined); + ok(false, "expected exception calling __defineGetter__ with undefined"); + }catch(e) { + ok(e.number === 0xa138a - 0x80000000, "__defineGetter__ with undefined threw exception " + e.number); + } + try { + x.__defineGetter__("bar", null); + ok(false, "expected exception calling __defineGetter__ with null"); + }catch(e) { + ok(e.number === 0xa138a - 0x80000000, "__defineGetter__ with null threw exception " + e.number); + } + try { + Object.prototype.__defineGetter__.call(x, "bar"); + ok(false, "expected exception calling __defineGetter__ with only one arg"); + }catch(e) { + ok(e.number === 0xa138a - 0x80000000, "__defineGetter__ with only one arg threw exception " + e.number); + } + + x.bar = "test"; + ok(x.bar === "test", "x.bar = " + x.bar); + x.__defineGetter__("bar", getter); + ok(x.bar === "wine", "x.bar with getter = " + x.bar); +}); + async_test("postMessage", function() { var v = document.documentMode; var onmessage_called = false; -- 2.34.1
[View Less]
3
20
0
0
[website] German translation for release 7.6
by Julian Rüger
11 Apr '22
11 Apr '22
Signed-off-by: Julian Rüger <jr98(a)gmx.net>
1
0
0
0
[website] German translation for WWN issue 415
by Julian Rüger
11 Apr '22
11 Apr '22
Signed-off-by: Julian Rüger <jr98(a)gmx.net>
1
0
0
0
[website] German translation for release 7.5
by Julian Rüger
11 Apr '22
11 Apr '22
Signed-off-by: Julian Rüger <jr98(a)gmx.net>
1
0
0
0
← Newer
1
...
62
63
64
65
66
67
68
...
94
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Results per page:
10
25
50
100
200