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
June 2022
----- 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
791 discussions
Start a n
N
ew thread
Tag wine-7.10 : Alexandre Julliard : Release 7.10
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: refs/tags/wine-7.10 Tag: c08570ebe2bbf1fe6bb64a9fabcb835ad4570472 URL:
https://source.winehq.org/git/wine.git/?a=tag;h=c08570ebe2bbf1fe6bb64a9fabc…
Tagger: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jun 3 22:51:22 2022 +0200 Release 7.10
1
0
0
0
Alexandre Julliard : Release 7.10.
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: master Commit: 631f4d5e42b7c2f705eb4b40eeea0ce1866bf513 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=631f4d5e42b7c2f705eb4b40…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jun 3 22:51:22 2022 +0200 Release 7.10. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- ANNOUNCE | 948 +++++++++++++++++++++++++++++++++----------------------------- AUTHORS | 3 + VERSION | 2 +- configure | 18 +- 4 files changed, 523 insertions(+), 448 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=631f4d5e42b7c2f705eb…
1
0
0
0
Gabriel Ivăncescu : jscript: Don't allow construction on builtin methods.
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: master Commit: 738e306bf72fface4a813f2a990e7d6eed310373 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=738e306bf72fface4a813f2a…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Jun 2 20:00:48 2022 +0300 jscript: Don't allow construction on builtin methods. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/function.c | 2 ++ dlls/jscript/tests/api.js | 1 + 2 files changed, 3 insertions(+) diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 984eebf4270..bf152e22868 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -619,6 +619,8 @@ static HRESULT NativeFunction_call(script_ctx_t *ctx, FunctionInstance *func, js { NativeFunction *function = (NativeFunction*)func; + if((flags & DISPATCH_CONSTRUCT) && !(function->function.flags & PROPF_CONSTR)) + return JS_E_INVALID_ACTION; return function->proc(ctx, vthis, flags & ~DISPATCH_JSCRIPT_INTERNAL_MASK, argc, argv, r); } diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 1368f399b50..123665cfdde 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -2622,6 +2622,7 @@ testException(function() {"test" in nullDisp;}, "E_OBJECT_EXPECTED"); testException(function() {new 3;}, "E_UNSUPPORTED_ACTION"); testException(function() {new null;}, "E_OBJECT_EXPECTED"); testException(function() {new nullDisp;}, "E_NO_PROPERTY"); +testException(function() {new Math.max(5);}, "E_UNSUPPORTED_ACTION"); testException(function() {new VBArray();}, "E_NOT_VBARRAY"); testException(function() {new VBArray(new VBArray(createArray()));}, "E_NOT_VBARRAY"); testException(function() {VBArray.prototype.lbound.call(new Object());}, "E_NOT_VBARRAY");
1
0
0
0
Gabriel Ivăncescu : jscript: Release all globals when the script is uninitialized.
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: master Commit: 79e51d6bc50bc1d519c275944f5b87ccc503c216 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=79e51d6bc50bc1d519c27594…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Jun 2 20:00:47 2022 +0300 jscript: Release all globals when the script is uninitialized. Most of these globals were leaking before as they were never freed at all. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/jscript.c | 31 ++++++++++++------------------ dlls/jscript/jscript.h | 50 +++++++++++++++++++++++++++--------------------- dlls/jscript/tests/run.c | 1 - 3 files changed, 40 insertions(+), 42 deletions(-) diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index d6028e69888..8a54f32f234 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -91,6 +91,17 @@ void script_release(script_ctx_t *ctx) heap_free(ctx); } +static void script_globals_release(script_ctx_t *ctx) +{ + unsigned i; + for(i = 0; i < ARRAY_SIZE(ctx->global_objects); i++) { + if(ctx->global_objects[i]) { + jsdisp_release(ctx->global_objects[i]); + ctx->global_objects[i] = NULL; + } + } +} + static void change_state(JScript *This, SCRIPTSTATE state) { if(This->ctx->state == state) @@ -483,25 +494,7 @@ static void decrease_state(JScript *This, SCRIPTSTATE state) This->ctx->site = NULL; } - if(This->ctx->map_prototype) { - jsdisp_release(This->ctx->map_prototype); - This->ctx->map_prototype = NULL; - } - - if(This->ctx->set_prototype) { - jsdisp_release(This->ctx->set_prototype); - This->ctx->set_prototype = NULL; - } - - if(This->ctx->object_prototype) { - jsdisp_release(This->ctx->object_prototype); - This->ctx->object_prototype = NULL; - } - - if(This->ctx->global) { - jsdisp_release(This->ctx->global); - This->ctx->global = NULL; - } + script_globals_release(This->ctx); /* FALLTHROUGH */ case SCRIPTSTATE_UNINITIALIZED: change_state(This, state); diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 000bcc287f4..0f8baea0188 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -387,29 +387,35 @@ struct _script_ctx_t { DWORD last_match_index; DWORD last_match_length; - jsdisp_t *global; - jsdisp_t *function_constr; - jsdisp_t *array_constr; - jsdisp_t *bool_constr; - jsdisp_t *date_constr; - jsdisp_t *enumerator_constr; - jsdisp_t *error_constr; - jsdisp_t *eval_error_constr; - jsdisp_t *range_error_constr; - jsdisp_t *reference_error_constr; - jsdisp_t *regexp_error_constr; - jsdisp_t *syntax_error_constr; - jsdisp_t *type_error_constr; - jsdisp_t *uri_error_constr; - jsdisp_t *number_constr; - jsdisp_t *object_constr; - jsdisp_t *object_prototype; - jsdisp_t *regexp_constr; - jsdisp_t *string_constr; - jsdisp_t *vbarray_constr; - jsdisp_t *map_prototype; - jsdisp_t *set_prototype; + union { + struct { + jsdisp_t *global; + jsdisp_t *function_constr; + jsdisp_t *array_constr; + jsdisp_t *bool_constr; + jsdisp_t *date_constr; + jsdisp_t *enumerator_constr; + jsdisp_t *error_constr; + jsdisp_t *eval_error_constr; + jsdisp_t *range_error_constr; + jsdisp_t *reference_error_constr; + jsdisp_t *regexp_error_constr; + jsdisp_t *syntax_error_constr; + jsdisp_t *type_error_constr; + jsdisp_t *uri_error_constr; + jsdisp_t *number_constr; + jsdisp_t *object_constr; + jsdisp_t *object_prototype; + jsdisp_t *regexp_constr; + jsdisp_t *string_constr; + jsdisp_t *vbarray_constr; + jsdisp_t *map_prototype; + jsdisp_t *set_prototype; + }; + jsdisp_t *global_objects[22]; + }; }; +C_ASSERT(RTL_SIZEOF_THROUGH_FIELD(script_ctx_t, set_prototype) == RTL_SIZEOF_THROUGH_FIELD(script_ctx_t, global_objects)); void script_release(script_ctx_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index f7ad1feb408..ec054f03d0d 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -3293,7 +3293,6 @@ static void test_invokeex(void) str = SysAllocString(L"call"); hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id); SysFreeString(str); - todo_wine ok(hres == E_UNEXPECTED, "GetDispID failed: %08lx\n", hres); IDispatchEx_Release(dispex);
1
0
0
0
Gabriel Ivăncescu : jscript: Forward actual error in to_primitive if it's not just missing prop.
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: master Commit: c35e5274edcbd70df5a96057d1de35d06264f4f4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c35e5274edcbd70df5a96057…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Jun 2 20:00:46 2022 +0300 jscript: Forward actual error in to_primitive if it's not just missing prop. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/jsutils.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 3251abfddbf..96e42625dc6 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -422,6 +422,9 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint) }else { IDispatch_Release(get_object(prim)); } + }else if(hres != DISP_E_UNKNOWNNAME) { + jsdisp_release(jsdisp); + return hres; } hres = jsdisp_get_id(jsdisp, hint == HINT_STRING ? L"valueOf" : L"toString", 0, &id); @@ -438,6 +441,9 @@ HRESULT to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *ret, hint_t hint) }else { IDispatch_Release(get_object(prim)); } + }else if(hres != DISP_E_UNKNOWNNAME) { + jsdisp_release(jsdisp); + return hres; } jsdisp_release(jsdisp);
1
0
0
0
Gabriel Ivăncescu : jscript: Don't execute any functions if script state does not allow it.
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: master Commit: 469219dcf7d7455b680ff2a6d799794c52956bd3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=469219dcf7d7455b680ff2a6…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Jun 2 20:00:45 2022 +0300 jscript: Don't execute any functions if script state does not allow it. Instead of only interpreted functions. Property retrievals or setters are allowed though, as long as they are not accessors. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/dispex.c | 3 ++ dlls/jscript/function.c | 10 ++--- dlls/jscript/tests/run.c | 111 +++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 111 insertions(+), 13 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index df829b76c4d..298f7e1af89 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -1971,6 +1971,9 @@ HRESULT jsdisp_call_value(jsdisp_t *jsfunc, IDispatch *jsthis, WORD flags, unsig return JS_E_FUNCTION_EXPECTED; } + if(jsfunc->ctx->state == SCRIPTSTATE_UNINITIALIZED || jsfunc->ctx->state == SCRIPTSTATE_CLOSED) + return E_UNEXPECTED; + flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; hres = jsfunc->builtin_info->call(jsfunc->ctx, jsthis ? jsval_disp(jsthis) : jsval_null(), flags, argc, argv, r); } diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 18465e53a86..984eebf4270 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -257,6 +257,11 @@ HRESULT Function_invoke(jsdisp_t *func_this, IDispatch *jsthis, WORD flags, unsi assert(is_class(func_this, JSCLASS_FUNCTION)); function = function_from_jsdisp(func_this); + if(function->dispex.ctx->state == SCRIPTSTATE_UNINITIALIZED || function->dispex.ctx->state == SCRIPTSTATE_CLOSED) { + WARN("Script engine state does not allow running code.\n"); + return E_UNEXPECTED; + } + if(jsthis) vthis = jsval_disp(jsthis); else @@ -725,11 +730,6 @@ static HRESULT InterpretedFunction_call(script_ctx_t *ctx, FunctionInstance *fun TRACE("%p\n", function); - if(ctx->state == SCRIPTSTATE_UNINITIALIZED || ctx->state == SCRIPTSTATE_CLOSED) { - WARN("Script engine state does not allow running code.\n"); - return E_UNEXPECTED; - } - if(flags & DISPATCH_CONSTRUCT) { hres = create_object(ctx, &function->function.dispex, &new_obj); if(FAILED(hres)) diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index 94dc2e1f440..f7ad1feb408 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -2914,13 +2914,20 @@ static void test_default_value(void) V_VT(&v) = VT_EMPTY; hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); - ok(hres == S_OK || broken(hres == 0x8000ffff), "Invoke failed: %08lx\n", hres); - if(hres == S_OK) - { - ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); - } + ok(hres == E_UNEXPECTED, "Invoke failed: %08lx\n", hres); + + hres = parse_script_expr(L"new Date()", &v, &script); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); + disp = V_DISPATCH(&v); + + V_VT(&v) = VT_EMPTY; + hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); + ok(hres == S_OK, "Invoke failed: %08lx\n", hres); + ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v)); VariantClear(&v); IDispatch_Release(disp); + close_script(script); hres = parse_script_expr(L"var arr = [5]; arr.toString = function() {return \"foo\";}; arr.valueOf = function() {return 42;}; arr", &v, &script); ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); @@ -3149,15 +3156,15 @@ static void test_script_exprs(void) static void test_invokeex(void) { - DISPID func_id, prop_id; - DISPPARAMS dp = {NULL}; + DISPPARAMS dp = {NULL}, dp_max = {NULL}; + DISPID func_id, max_id, prop_id; IActiveScript *script; IDispatchEx *dispex; VARIANT v, arg; BSTR str; HRESULT hres; - hres = parse_script_expr(L"var o = {func: function() {return 3;}, prop: 6}; o", &v, &script); + hres = parse_script_expr(L"var o = {func: function() {return 3;}, max: Math.max, prop: 6}; o", &v, &script); ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); @@ -3170,16 +3177,31 @@ static void test_invokeex(void) SysFreeString(str); ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + str = SysAllocString(L"max"); + hres = IDispatchEx_GetDispID(dispex, str, 0, &max_id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + str = SysAllocString(L"prop"); hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id); SysFreeString(str); ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + dp_max.rgvarg = &arg; + dp_max.cArgs = 1; + V_VT(&arg) = VT_I4; + V_I4(&arg) = 42; + hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL); ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); ok(V_I4(&v) == 3, "V_I4(v) = %ld\n", V_I4(&v)); + hres = IDispatchEx_InvokeEx(dispex, max_id, 0, DISPATCH_METHOD, &dp_max, &v, NULL, NULL); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); + ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_I4(&v) == 42, "V_I4(v) = %ld\n", V_I4(&v)); + hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); @@ -3193,9 +3215,23 @@ static void test_invokeex(void) SysFreeString(str); ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + V_VT(&v) = VT_EMPTY; hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL); ok(hres == E_UNEXPECTED || broken(hres == 0x800a1393), "InvokeEx failed: %08lx\n", hres); + V_VT(&v) = VT_EMPTY; + hres = IDispatchEx_InvokeEx(dispex, max_id, 0, DISPATCH_METHOD, &dp_max, &v, NULL, NULL); + ok(hres == E_UNEXPECTED || broken(hres == 0x800a1393), "InvokeEx failed: %08lx\n", hres); + + V_VT(&v) = VT_EMPTY; + hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); + ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_I4(&v) == 6, "V_I4(v) = %ld\n", V_I4(&v)); + + IActiveScript_Close(script); + + V_VT(&v) = VT_EMPTY; hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); @@ -3204,6 +3240,65 @@ static void test_invokeex(void) IDispatchEx_Release(dispex); IActiveScript_Release(script); + hres = parse_script_expr(L"Math.max", &v, &script); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); + + hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); + VariantClear(&v); + + str = SysAllocString(L"call"); + hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + + hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres); + + str = SysAllocString(L"call"); + hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + + str = SysAllocString(L"length"); + hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID failed: %08lx\n", hres); + + hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); + VariantClear(&v); + + hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL); + ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres); + ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_I4(&v) == 2, "V_I4(v) = %ld\n", V_I4(&v)); + + IDispatchEx_Release(dispex); + IActiveScript_Release(script); + + hres = parse_script_expr(L"Math.max", &v, &script); + ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres); + ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v)); + + hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex); + ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres); + VariantClear(&v); + + hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres); + + str = SysAllocString(L"call"); + hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id); + SysFreeString(str); + todo_wine + ok(hres == E_UNEXPECTED, "GetDispID failed: %08lx\n", hres); + + IDispatchEx_Release(dispex); + IActiveScript_Release(script); + /* test InvokeEx following prototype chain of builtin object (PROP_PROTREF) */ hres = parse_script_expr(L"o = new Array(); o.push(\"foo\"); o", &v, &script); ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
1
0
0
0
Gabriel Ivăncescu : jscript: Setup builtin function when the dispid is retrieved.
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: master Commit: c8d7d504eb2c4fe063e3750091051f2b902fd946 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c8d7d504eb2c4fe063e37500…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Jun 2 20:00:44 2022 +0300 jscript: Setup builtin function when the dispid is retrieved. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/dispex.c | 67 ++++++++++++++++--------------------------------- dlls/jscript/function.c | 3 +++ 2 files changed, 25 insertions(+), 45 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 468a0ddf557..df829b76c4d 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -242,6 +242,7 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, const builtin_prop_t *builtin; unsigned bucket, pos, prev = ~0; dispex_prop_t *prop; + HRESULT hres; bucket = get_props_idx(This, hash); pos = This->props[bucket].bucket_head; @@ -264,9 +265,24 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, builtin = find_builtin_prop(This, name); if(builtin) { unsigned flags = builtin->flags; - if(flags & PROPF_METHOD) - flags |= PROPF_WRITABLE | PROPF_CONFIGURABLE; - else if(builtin->setter) + if(flags & PROPF_METHOD) { + jsdisp_t *obj; + + hres = create_builtin_function(This->ctx, builtin->invoke, builtin->name, NULL, flags, NULL, &obj); + if(FAILED(hres)) + return hres; + + prop = alloc_prop(This, name, PROP_JSVAL, (flags & PROPF_ALL) | PROPF_WRITABLE | PROPF_CONFIGURABLE); + if(!prop) { + jsdisp_release(obj); + return E_OUTOFMEMORY; + } + + prop->type = PROP_JSVAL; + prop->u.val = jsval_obj(obj); + *ret = prop; + return S_OK; + }else if(builtin->setter) flags |= PROPF_WRITABLE; flags &= PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE; prop = alloc_prop(This, name, PROP_BUILTIN, flags); @@ -431,23 +447,7 @@ static HRESULT prop_get(jsdisp_t *This, dispex_prop_t *prop, jsval_t *r) switch(prop->type) { case PROP_BUILTIN: - if(prop->u.p->getter) { - hres = prop->u.p->getter(This->ctx, This, r); - }else { - jsdisp_t *obj; - - assert(prop->u.p->invoke != NULL); - hres = create_builtin_function(This->ctx, prop->u.p->invoke, prop->u.p->name, NULL, - prop->u.p->flags, NULL, &obj); - if(FAILED(hres)) - break; - - prop->type = PROP_JSVAL; - prop->u.val = jsval_obj(obj); - - jsdisp_addref(obj); - *r = jsval_obj(obj); - } + hres = prop->u.p->getter(This->ctx, This, r); break; case PROP_JSVAL: hres = jsval_copy(prop->u.val, r); @@ -497,12 +497,6 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) switch(prop->type) { case PROP_BUILTIN: - if(prop->u.p->invoke) { - prop->type = PROP_JSVAL; - prop->flags = PROPF_CONFIGURABLE | PROPF_WRITABLE; - prop->u.val = jsval_undefined(); - break; - } if(!prop->u.p->setter) { TRACE("getter with no setter\n"); return S_OK; @@ -557,25 +551,8 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t HRESULT hres; switch(prop->type) { - case PROP_BUILTIN: { - jsval_t vthis; - - if(!prop->u.p->invoke) - return JS_E_FUNCTION_EXPECTED; - - if(flags == DISPATCH_CONSTRUCT && (prop->flags & PROPF_METHOD)) { - WARN("%s is not a constructor\n", debugstr_w(prop->name)); - return E_INVALIDARG; - } - - if(This->builtin_info->class != JSCLASS_FUNCTION && prop->u.p->invoke != JSGlobal_eval) - flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; - if(jsthis) - vthis = jsval_disp(jsthis); - else - vthis = jsval_obj(This); - return prop->u.p->invoke(This->ctx, vthis, flags, argc, argv, r); - } + case PROP_BUILTIN: + return JS_E_FUNCTION_EXPECTED; case PROP_PROTREF: return invoke_prop_func(This->prototype, jsthis ? jsthis : (IDispatch *)&This->IDispatchEx_iface, This->prototype->props+prop->u.ref, flags, argc, argv, r, caller); diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 638d176cf2c..18465e53a86 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -664,6 +664,9 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, NativeFunction *function; HRESULT hres; + if(!ctx->function_constr) + return E_UNEXPECTED; + hres = create_function(ctx, builtin_info, &NativeFunctionVtbl, sizeof(NativeFunction), flags, FALSE, NULL, (void**)&function); if(FAILED(hres)) return hres;
1
0
0
0
Gabriel Ivăncescu : jscript: Don't allow starting script using state from uninitialized.
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: master Commit: 079b14b2e97234526c5f1a51d590c0c2d0db0ec7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=079b14b2e97234526c5f1a51…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Jun 2 20:00:43 2022 +0300 jscript: Don't allow starting script using state from uninitialized. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/jscript.c | 2 +- dlls/jscript/tests/jscript.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 8cf141d3990..d6028e69888 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -824,7 +824,7 @@ static HRESULT WINAPI JScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE s switch(ss) { case SCRIPTSTATE_STARTED: case SCRIPTSTATE_CONNECTED: /* FIXME */ - if(This->ctx->state == SCRIPTSTATE_CLOSED) + if(This->ctx->state == SCRIPTSTATE_UNINITIALIZED || This->ctx->state == SCRIPTSTATE_CLOSED) return E_UNEXPECTED; exec_queued_code(This); diff --git a/dlls/jscript/tests/jscript.c b/dlls/jscript/tests/jscript.c index 8c985e5c6a5..872354161fc 100644 --- a/dlls/jscript/tests/jscript.c +++ b/dlls/jscript/tests/jscript.c @@ -863,6 +863,12 @@ static void test_jscript_uninitializing(void) hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hres); + hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED); + ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_STARTED) returned: %08lx\n", hres); + + hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); + ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_CONNECTED) returned: %08lx\n", hres); + SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
1
0
0
0
Ziqing Hui : d2d1/tests: Test unregistering effect which has existing instance.
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: master Commit: 3eaac7211fdf985a9d443fce8555b9bac99a1327 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3eaac7211fdf985a9d443fce…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Thu Jun 2 18:17:04 2022 +0800 d2d1/tests: Test unregistering effect which has existing instance. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d2d1/tests/d2d1.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 397e460cbb2..bc662b4f8ae 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -10673,10 +10673,15 @@ static void test_effect_register(BOOL d3d11) ok(hr == test->hr, "Got unexpected hr %#lx, expected %#lx.\n", hr, test->hr); if (hr == S_OK) { + effect = NULL; + hr = ID2D1DeviceContext_CreateEffect(device_context, &CLSID_TestEffect, &effect); + todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); todo_wine ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); hr = ID2D1Factory1_UnregisterEffect(factory, &CLSID_TestEffect); todo_wine ok(hr == D2DERR_EFFECT_IS_NOT_REGISTERED, "Got unexpected hr %#lx.\n", hr); + if (effect) + ID2D1Effect_Release(effect); } winetest_pop_context();
1
0
0
0
Ziqing Hui : d2d1/tests: Test custom effect properties.
by Alexandre Julliard
03 Jun '22
03 Jun '22
Module: wine Branch: master Commit: 5cb2c805b19d9a4285adc7086798da708f54c617 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5cb2c805b19d9a4285adc708…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Thu Jun 2 18:17:03 2022 +0800 d2d1/tests: Test custom effect properties. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d2d1/tests/d2d1.c | 251 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=5cb2c805b19d9a4285ad…
1
0
0
0
← Newer
1
...
66
67
68
69
70
71
72
...
80
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
Results per page:
10
25
50
100
200