winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
710 discussions
Start a n
N
ew thread
Jacek Caban : vbscript: Added parameterized assign identifier statement support.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: 732abbbcc33b167cca6a4ff7cdef788e6cf58fbc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=732abbbcc33b167cca6a4ff7c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 26 11:53:41 2012 +0200 vbscript: Added parameterized assign identifier statement support. --- dlls/vbscript/interp.c | 123 ++++++++++++++++++++++++++++++--------------- dlls/vbscript/vbdisp.c | 8 +-- dlls/vbscript/vbscript.h | 2 +- 3 files changed, 86 insertions(+), 47 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 6e4827d..8cfec58 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -315,6 +315,35 @@ static HRESULT stack_pop_val(exec_ctx_t *ctx, variant_val_t *v) return S_OK; } +static HRESULT stack_assume_val(exec_ctx_t *ctx, unsigned n) +{ + VARIANT *v = stack_top(ctx, n); + HRESULT hres; + + if(V_VT(v) == (VT_BYREF|VT_VARIANT)) { + VARIANT *ref = V_VARIANTREF(v); + + V_VT(v) = VT_EMPTY; + hres = VariantCopy(v, ref); + if(FAILED(hres)) + return hres; + } + + if(V_VT(v) == VT_DISPATCH) { + DISPPARAMS dp = {0}; + IDispatch *disp; + + disp = V_DISPATCH(v); + V_VT(v) = VT_EMPTY; + hres = disp_call(ctx->script, disp, DISPID_VALUE, &dp, v); + IDispatch_Release(disp); + if(FAILED(hres)) + return hres; + } + + return S_OK; +} + static inline void release_val(variant_val_t *v) { if(v->owned) @@ -380,11 +409,13 @@ static inline void instr_jmp(exec_ctx_t *ctx, unsigned addr) ctx->instr = ctx->code->instrs + addr; } -static void vbstack_to_dp(exec_ctx_t *ctx, unsigned arg_cnt, DISPPARAMS *dp) +static void vbstack_to_dp(exec_ctx_t *ctx, unsigned arg_cnt, BOOL is_propput, DISPPARAMS *dp) { - dp->cArgs = arg_cnt; - dp->rgdispidNamedArgs = NULL; - dp->cNamedArgs = 0; + static DISPID propput_dispid = DISPID_PROPERTYPUT; + + dp->cNamedArgs = is_propput ? 1 : 0; + dp->cArgs = arg_cnt + dp->cNamedArgs; + dp->rgdispidNamedArgs = is_propput ? &propput_dispid : NULL; if(arg_cnt) { VARIANT tmp; @@ -398,9 +429,9 @@ static void vbstack_to_dp(exec_ctx_t *ctx, unsigned arg_cnt, DISPPARAMS *dp) ctx->stack[ctx->top-arg_cnt+i-1] = tmp; } - dp->rgvarg = ctx->stack + ctx->top-arg_cnt; + dp->rgvarg = ctx->stack + ctx->top-dp->cArgs; }else { - dp->rgvarg = NULL; + dp->rgvarg = is_propput ? ctx->stack+ctx->top-1 : NULL; } } @@ -416,7 +447,7 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) if(FAILED(hres)) return hres; - vbstack_to_dp(ctx, arg_cnt, &dp); + vbstack_to_dp(ctx, arg_cnt, FALSE, &dp); switch(ref.type) { case REF_VAR: @@ -503,7 +534,7 @@ static HRESULT do_mcall(exec_ctx_t *ctx, VARIANT *res) return E_FAIL; } - vbstack_to_dp(ctx, arg_cnt, &dp); + vbstack_to_dp(ctx, arg_cnt, FALSE, &dp); hres = disp_get_id(obj, identifier, VBDISP_CALLGET, FALSE, &id); if(SUCCEEDED(hres)) @@ -537,7 +568,7 @@ static HRESULT interp_mcallv(exec_ctx_t *ctx) return do_mcall(ctx, NULL); } -static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_val) +static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, DISPPARAMS *dp) { ref_t ref; HRESULT hres; @@ -550,22 +581,19 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_v case REF_VAR: { VARIANT *v = ref.u.v; + if(arg_cnt(dp)) { + FIXME("arg_cnt %d not supported\n", arg_cnt(dp)); + return E_NOTIMPL; + } + if(V_VT(v) == (VT_VARIANT|VT_BYREF)) v = V_VARIANTREF(v); - if(own_val) { - VariantClear(v); - *v = *val; - hres = S_OK; - }else { - hres = VariantCopy(v, val); - } + hres = VariantCopy(v, dp->rgvarg); break; } case REF_DISP: - hres = disp_propput(ctx->script, ref.u.d.disp, ref.u.d.id, val); - if(own_val) - VariantClear(val); + hres = disp_propput(ctx->script, ref.u.d.disp, ref.u.d.id, dp); break; case REF_FUNC: FIXME("functions not implemented\n"); @@ -581,8 +609,13 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_v FIXME("throw exception\n"); hres = E_FAIL; }else { + if(arg_cnt(dp)) { + FIXME("arg_cnt %d not supported\n", arg_cnt(dp)); + return E_NOTIMPL; + } + TRACE("creating variable %s\n", debugstr_w(name)); - hres = add_dynamic_var(ctx, name, FALSE, val, own_val); + hres = add_dynamic_var(ctx, name, FALSE, dp->rgvarg, FALSE); } } @@ -593,29 +626,29 @@ static HRESULT interp_assign_ident(exec_ctx_t *ctx) { const BSTR arg = ctx->instr->arg1.bstr; const unsigned arg_cnt = ctx->instr->arg2.uint; - variant_val_t v; + DISPPARAMS dp; HRESULT hres; TRACE("%s\n", debugstr_w(arg)); - if(arg_cnt) { - FIXME("arguments not supported\n"); - return E_NOTIMPL; - } + hres = stack_assume_val(ctx, arg_cnt); + if(FAILED(hres)) + return hres; - hres = stack_pop_val(ctx, &v); + vbstack_to_dp(ctx, arg_cnt, TRUE, &dp); + hres = assign_ident(ctx, arg, &dp); if(FAILED(hres)) return hres; - return assign_ident(ctx, arg, v.v, v.owned); + stack_popn(ctx, arg_cnt+1); + return S_OK; } static HRESULT interp_set_ident(exec_ctx_t *ctx) { const BSTR arg = ctx->instr->arg1.bstr; const unsigned arg_cnt = ctx->instr->arg2.uint; - IDispatch *disp; - VARIANT v; + DISPPARAMS dp; HRESULT hres; TRACE("%s\n", debugstr_w(arg)); @@ -625,21 +658,25 @@ static HRESULT interp_set_ident(exec_ctx_t *ctx) return E_NOTIMPL; } - hres = stack_pop_disp(ctx, &disp); + hres = stack_assume_disp(ctx, 0, NULL); if(FAILED(hres)) return hres; - V_VT(&v) = VT_DISPATCH; - V_DISPATCH(&v) = disp; - return assign_ident(ctx, ctx->instr->arg1.bstr, &v, TRUE); + vbstack_to_dp(ctx, 0, TRUE, &dp); + hres = assign_ident(ctx, ctx->instr->arg1.bstr, &dp); + if(FAILED(hres)) + return hres; + + stack_popn(ctx, 1); + return S_OK; } static HRESULT interp_assign_member(exec_ctx_t *ctx) { BSTR identifier = ctx->instr->arg1.bstr; const unsigned arg_cnt = ctx->instr->arg2.uint; - variant_val_t val; IDispatch *obj; + DISPPARAMS dp; DISPID id; HRESULT hres; @@ -659,18 +696,19 @@ static HRESULT interp_assign_member(exec_ctx_t *ctx) return E_FAIL; } - hres = stack_pop_val(ctx, &val); + hres = stack_assume_val(ctx, arg_cnt); if(FAILED(hres)) return hres; hres = disp_get_id(obj, identifier, VBDISP_LET, FALSE, &id); - if(SUCCEEDED(hres)) - hres = disp_propput(ctx->script, obj, id, val.v); - release_val(&val); + if(SUCCEEDED(hres)) { + vbstack_to_dp(ctx, arg_cnt, TRUE, &dp); + hres = disp_propput(ctx->script, obj, id, &dp); + } if(FAILED(hres)) return hres; - stack_popn(ctx, 1); + stack_popn(ctx, 2); return S_OK; } @@ -679,6 +717,7 @@ static HRESULT interp_set_member(exec_ctx_t *ctx) BSTR identifier = ctx->instr->arg1.bstr; const unsigned arg_cnt = ctx->instr->arg2.uint; IDispatch *obj; + DISPPARAMS dp; DISPID id; HRESULT hres; @@ -703,8 +742,10 @@ static HRESULT interp_set_member(exec_ctx_t *ctx) return hres; hres = disp_get_id(obj, identifier, VBDISP_SET, FALSE, &id); - if(SUCCEEDED(hres)) - hres = disp_propput(ctx->script, obj, id, stack_top(ctx, 0)); + if(SUCCEEDED(hres)) { + vbstack_to_dp(ctx, arg_cnt, TRUE, &dp); + hres = disp_propput(ctx->script, obj, id, &dp); + } if(FAILED(hres)) return hres; diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c index ab62c9f..1e9245a 100644 --- a/dlls/vbscript/vbdisp.c +++ b/dlls/vbscript/vbdisp.c @@ -576,23 +576,21 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp, return hres; } -HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, VARIANT *val) +HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp) { - DISPID propput_dispid = DISPID_PROPERTYPUT; - DISPPARAMS dp = {val, &propput_dispid, 1, 1}; IDispatchEx *dispex; EXCEPINFO ei = {0}; HRESULT hres; hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); if(SUCCEEDED(hres)) { - hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL /* FIXME! */); + hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, DISPATCH_PROPERTYPUT, dp, NULL, &ei, NULL /* FIXME! */); IDispatchEx_Release(dispex); }else { ULONG err = 0; TRACE("using IDispatch\n"); - hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, &err); + hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, DISPATCH_PROPERTYPUT, dp, NULL, &ei, &err); } return hres; diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 173b03e..432380d 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -119,7 +119,7 @@ HRESULT create_vbdisp(const class_desc_t*,vbdisp_t**) DECLSPEC_HIDDEN; HRESULT disp_get_id(IDispatch*,BSTR,vbdisp_invoke_type_t,BOOL,DISPID*) DECLSPEC_HIDDEN; HRESULT vbdisp_get_id(vbdisp_t*,BSTR,vbdisp_invoke_type_t,BOOL,DISPID*) DECLSPEC_HIDDEN; HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,VARIANT*) DECLSPEC_HIDDEN; -HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,VARIANT*) DECLSPEC_HIDDEN; +HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN; void collect_objects(script_ctx_t*) DECLSPEC_HIDDEN; static inline unsigned arg_cnt(const DISPPARAMS *dp)
1
0
0
0
Jacek Caban : vbscript: Evaluate object expression before value expression in member assignment.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: 1e5c2134f1c1626b5f9931e439a56362b54877ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1e5c2134f1c1626b5f9931e43…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 26 11:53:08 2012 +0200 vbscript: Evaluate object expression before value expression in member assignment. --- dlls/vbscript/compile.c | 8 +++--- dlls/vbscript/interp.c | 68 ++++++++++++++++++++++++++++++---------------- 2 files changed, 48 insertions(+), 28 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 846a55d..f3d88a0 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -697,10 +697,6 @@ static HRESULT compile_assign_statement(compile_ctx_t *ctx, assign_statement_t * vbsop_t op; HRESULT hres; - hres = compile_expression(ctx, stat->value_expr); - if(FAILED(hres)) - return hres; - if(stat->member_expr->obj_expr) { hres = compile_expression(ctx, stat->member_expr->obj_expr); if(FAILED(hres)) @@ -711,6 +707,10 @@ static HRESULT compile_assign_statement(compile_ctx_t *ctx, assign_statement_t * op = is_set ? OP_set_ident : OP_assign_ident; } + hres = compile_expression(ctx, stat->value_expr); + if(FAILED(hres)) + return hres; + hres = compile_args(ctx, stat->member_expr->args, &args_cnt); if(FAILED(hres)) return hres; diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 82e3724..6e4827d 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -348,6 +348,33 @@ static HRESULT stack_pop_disp(exec_ctx_t *ctx, IDispatch **ret) return S_OK; } +static HRESULT stack_assume_disp(exec_ctx_t *ctx, unsigned n, IDispatch **disp) +{ + VARIANT *v = stack_top(ctx, n), *ref; + + if(V_VT(v) != VT_DISPATCH) { + if(V_VT(v) != (VT_VARIANT|VT_BYREF)) { + FIXME("not supported type: %s\n", debugstr_variant(v)); + return E_FAIL; + } + + ref = V_VARIANTREF(v); + if(V_VT(ref) != VT_DISPATCH) { + FIXME("not disp %s\n", debugstr_variant(ref)); + return E_FAIL; + } + + V_VT(v) = VT_DISPATCH; + V_DISPATCH(v) = V_DISPATCH(ref); + if(V_DISPATCH(v)) + IDispatch_AddRef(V_DISPATCH(v)); + } + + if(disp) + *disp = V_DISPATCH(v); + return S_OK; +} + static inline void instr_jmp(exec_ctx_t *ctx, unsigned addr) { ctx->instr = ctx->code->instrs + addr; @@ -623,7 +650,7 @@ static HRESULT interp_assign_member(exec_ctx_t *ctx) return E_NOTIMPL; } - hres = stack_pop_disp(ctx, &obj); + hres = stack_assume_disp(ctx, arg_cnt+1, &obj); if(FAILED(hres)) return hres; @@ -633,25 +660,25 @@ static HRESULT interp_assign_member(exec_ctx_t *ctx) } hres = stack_pop_val(ctx, &val); - if(FAILED(hres)) { - IDispatch_Release(obj); + if(FAILED(hres)) return hres; - } hres = disp_get_id(obj, identifier, VBDISP_LET, FALSE, &id); if(SUCCEEDED(hres)) hres = disp_propput(ctx->script, obj, id, val.v); - release_val(&val); - IDispatch_Release(obj); - return hres; + if(FAILED(hres)) + return hres; + + stack_popn(ctx, 1); + return S_OK; } static HRESULT interp_set_member(exec_ctx_t *ctx) { BSTR identifier = ctx->instr->arg1.bstr; const unsigned arg_cnt = ctx->instr->arg2.uint; - IDispatch *obj, *val; + IDispatch *obj; DISPID id; HRESULT hres; @@ -662,7 +689,7 @@ static HRESULT interp_set_member(exec_ctx_t *ctx) return E_NOTIMPL; } - hres = stack_pop_disp(ctx, &obj); + hres = stack_assume_disp(ctx, 1, &obj); if(FAILED(hres)) return hres; @@ -671,25 +698,18 @@ static HRESULT interp_set_member(exec_ctx_t *ctx) return E_FAIL; } - hres = stack_pop_disp(ctx, &val); - if(FAILED(hres)) { - IDispatch_Release(obj); + hres = stack_assume_disp(ctx, 0, NULL); + if(FAILED(hres)) return hres; - } hres = disp_get_id(obj, identifier, VBDISP_SET, FALSE, &id); - if(SUCCEEDED(hres)) { - VARIANT v; - - V_VT(&v) = VT_DISPATCH; - V_DISPATCH(&v) = val; - hres = disp_propput(ctx->script, obj, id, &v); - } + if(SUCCEEDED(hres)) + hres = disp_propput(ctx->script, obj, id, stack_top(ctx, 0)); + if(FAILED(hres)) + return hres; - if(val) - IDispatch_Release(val); - IDispatch_Release(obj); - return hres; + stack_popn(ctx, 2); + return S_OK; } static HRESULT interp_const(exec_ctx_t *ctx)
1
0
0
0
Jacek Caban : vbscript: Init destination before passing it to VariantCopy in add_dynamic_var.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: 434700bf6b57bfabc86af20bc9a3f430ed84e36a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=434700bf6b57bfabc86af20bc…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 26 11:52:47 2012 +0200 vbscript: Init destination before passing it to VariantCopy in add_dynamic_var. --- dlls/vbscript/interp.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index df30e0e..82e3724 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -229,6 +229,7 @@ static HRESULT add_dynamic_var(exec_ctx_t *ctx, const WCHAR *name, BOOL is_const if(own_val) { new_var->v = *val; }else { + V_VT(&new_var->v) = VT_EMPTY; hres = VariantCopy(&new_var->v, val); if(FAILED(hres)) return hres;
1
0
0
0
Jacek Caban : vbscript: Lookup visible items before global members in lookup_identifier.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: e4bfd4e0574c435f20501d3a0f98f4239fbf547a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e4bfd4e0574c435f20501d3a0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 26 11:52:33 2012 +0200 vbscript: Lookup visible items before global members in lookup_identifier. --- dlls/vbscript/interp.c | 22 ++++++++++++---------- dlls/vbscript/tests/run.c | 6 ++++++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 4be1d43..df30e0e 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -164,16 +164,6 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ } LIST_FOR_EACH_ENTRY(item, &ctx->script->named_items, named_item_t, entry) { - if((item->flags & SCRIPTITEM_GLOBALMEMBERS)) { - hres = disp_get_id(item->disp, name, invoke_type, FALSE, &id); - if(SUCCEEDED(hres)) { - ref->type = REF_DISP; - ref->u.d.disp = item->disp; - ref->u.d.id = id; - return S_OK; - } - } - if((item->flags & SCRIPTITEM_ISVISIBLE) && !strcmpiW(item->name, name)) { if(!item->disp) { IUnknown *unk; @@ -198,6 +188,18 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ } } + LIST_FOR_EACH_ENTRY(item, &ctx->script->named_items, named_item_t, entry) { + if((item->flags & SCRIPTITEM_GLOBALMEMBERS)) { + hres = disp_get_id(item->disp, name, invoke_type, FALSE, &id); + if(SUCCEEDED(hres)) { + ref->type = REF_DISP; + ref->u.d.disp = item->disp; + ref->u.d.id = id; + return S_OK; + } + } + } + ref->type = REF_NONE; return S_OK; } diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 43c9be4..3fb506b 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -1197,6 +1197,12 @@ static void run_tests(void) CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i); + SET_EXPECT(global_success_d); + SET_EXPECT(global_success_i); + parse_script_a("test.reportSuccess()"); + CHECK_CALLED(global_success_d); + CHECK_CALLED(global_success_i); + SET_EXPECT(global_vbvar_d); SET_EXPECT(global_vbvar_i); parse_script_a("Option Explicit\nvbvar = 3");
1
0
0
0
Jacek Caban : jscript: Added decoding tests.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: c18b84cf4e9ee3127d354de06650b4bb04be54d9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c18b84cf4e9ee3127d354de06…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 26 11:43:23 2012 +0200 jscript: Added decoding tests. --- dlls/jscript/tests/run.c | 83 +++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 79 insertions(+), 4 deletions(-) diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index 64a8c7e..dbf83e6 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -29,6 +29,8 @@ static const CLSID CLSID_JScript = {0xf414c260,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}; +static const CLSID CLSID_JScriptEncode = + {0xf414c262,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}; #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE @@ -97,6 +99,8 @@ DEFINE_EXPECT(DeleteMemberByDispID); #define DISPID_TESTOBJ_PROP 0x2000 #define DISPID_TESTOBJ_ONLYDISPID 0x2001 +#define JS_E_INVALID_CHAR 0x800a03f6 + static const WCHAR testW[] = {'t','e','s','t',0}; static const CHAR testA[] = "test"; static const WCHAR test_valW[] = {'t','e','s','t','V','a','l',0}; @@ -107,6 +111,7 @@ static const char *test_name = "(null)"; static IDispatch *script_disp; static int invoke_version; static IActiveScriptError *script_error; +static const CLSID *engine_clsid = &CLSID_JScript; /* Returns true if the user interface is in English. Note that this does not * presume of the formatting of dates, numbers, etc. @@ -1016,7 +1021,7 @@ static IActiveScript *create_script(void) VARIANT v; HRESULT hres; - hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + hres = CoCreateInstance(engine_clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IActiveScript, (void**)&script); ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); @@ -1440,7 +1445,7 @@ static void test_isvisible(BOOL global_members) IUnknown_Release(parser); } -static void run_tests(void) +static BOOL run_tests(void) { HRESULT hres; @@ -1450,7 +1455,7 @@ static void run_tests(void) script = create_script(); if(!script) { win_skip("Could not create script\n"); - return; + return FALSE; } IActiveScript_Release(script); } @@ -1648,6 +1653,73 @@ static void run_tests(void) "Microsoft JScript runtime error", "Object expected", NULL); + + return TRUE; +} + +static void run_encoded_tests(void) +{ + BSTR src; + HRESULT hres; + + engine_clsid = &CLSID_JScriptEncode; + + SET_EXPECT(global_success_d); + SET_EXPECT(global_success_i); + /* |reportSuccess(); | */ + parse_script_a("#@~^EAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@"); + CHECK_CALLED(global_success_d); + CHECK_CALLED(global_success_i); + + SET_EXPECT(global_success_d); + SET_EXPECT(global_success_i); + parse_script_a("reportSuccess();"); + CHECK_CALLED(global_success_d); + CHECK_CALLED(global_success_i); + + SET_EXPECT(global_success_d); + SET_EXPECT(global_success_i); + /* |Success | */ + parse_script_a("report#@~^BwAAAA==j!m^\x7f/k2QIAAA==^#~@();"); + CHECK_CALLED(global_success_d); + CHECK_CALLED(global_success_i); + + SET_EXPECT(global_success_d); + SET_EXPECT(global_success_i); + /* |\r\n\treportSuccess();\r\n | */ + parse_script_a("#@~^GQAAAA==@#@&d.\x7fwKDYUE1^+k/c#p@#@&OAYAAA==^#~@"); + CHECK_CALLED(global_success_d); + CHECK_CALLED(global_success_i); + + /* v */ + src = a2bstr("#@~^EAA*AA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@"); + hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); + SysFreeString(src); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); + + /* vv */ + src = a2bstr("#@~^EAAAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@"); + hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); + SysFreeString(src); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); + + /* v */ + src = a2bstr("#@~^EAAAAA^=.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@"); + hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); + SysFreeString(src); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); + + /* v */ + src = a2bstr("#@~^EAAAAA==.\x7fwGMYUEm1ekd`*iAQYAAA==^#~@"); + hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); + SysFreeString(src); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); + + /* vv */ + src = a2bstr("#@~^EAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^~#@"); + hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src); + SysFreeString(src); + ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres); } static BOOL check_jscript(void) @@ -1690,7 +1762,10 @@ START_TEST(run) trace("invoke version 2\n"); invoke_version = 2; - run_tests(); + if(run_tests()) { + trace("JSctipt.Encode tests...\n"); + run_encoded_tests(); + } } CoUninitialize();
1
0
0
0
Jacek Caban : jscript: Added decoding support.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: f7a86505008bd3f98676d4aafcfa466952958bd3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f7a86505008bd3f98676d4aaf…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 26 11:42:51 2012 +0200 jscript: Added decoding support. --- dlls/jscript/Makefile.in | 1 + dlls/jscript/compile.c | 10 +++- dlls/jscript/decode.c | 180 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/jscript/engine.h | 2 +- dlls/jscript/function.c | 2 +- dlls/jscript/global.c | 2 +- dlls/jscript/jscript.c | 4 +- dlls/jscript/jscript.h | 5 +- dlls/jscript/jscript.rc | 1 + dlls/jscript/resource.h | 1 + po/ar.po | 44 ++++++----- po/bg.po | 45 +++++++----- po/ca.po | 46 +++++++----- po/cs.po | 45 +++++++----- po/da.po | 46 +++++++----- po/de.po | 46 +++++++----- po/el.po | 45 +++++++----- po/en.po | 44 ++++++----- po/en_US.po | 44 ++++++----- po/eo.po | 46 +++++++----- po/es.po | 46 +++++++----- po/fa.po | 44 ++++++----- po/fi.po | 46 +++++++----- po/fr.po | 46 +++++++----- po/he.po | 45 +++++++----- po/hi.po | 44 ++++++----- po/hu.po | 46 +++++++----- po/it.po | 46 +++++++----- po/ja.po | 46 +++++++----- po/ko.po | 46 +++++++----- po/lt.po | 46 +++++++----- po/ml.po | 44 ++++++----- po/nb_NO.po | 46 +++++++----- po/nl.po | 46 +++++++----- po/or.po | 44 ++++++----- po/pa.po | 44 ++++++----- po/pl.po | 46 +++++++----- po/pt_BR.po | 46 +++++++----- po/pt_PT.po | 46 +++++++----- po/rm.po | 44 ++++++----- po/ro.po | 45 +++++++----- po/ru.po | 46 +++++++----- po/sk.po | 46 +++++++----- po/sl.po | 46 +++++++----- po/sr_RS(a)cyrillic.po | 46 +++++++----- po/sr_RS(a)latin.po | 46 +++++++----- po/sv.po | 46 +++++++----- po/te.po | 44 ++++++----- po/th.po | 44 ++++++----- po/tr.po | 46 +++++++----- po/uk.po | 46 +++++++----- po/wa.po | 44 ++++++----- po/wine.pot | 44 ++++++----- po/zh_CN.po | 46 +++++++----- po/zh_TW.po | 46 +++++++----- 55 files changed, 1340 insertions(+), 907 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f7a86505008bd3f98676d…
1
0
0
0
Jacek Caban : jscript: Added JScriptEncode object tests.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: 129183ebb034dd65e2b1a94a516ceea8d0199df8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=129183ebb034dd65e2b1a94a5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 26 11:42:13 2012 +0200 jscript: Added JScriptEncode object tests. --- dlls/jscript/tests/jscript.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/dlls/jscript/tests/jscript.c b/dlls/jscript/tests/jscript.c index c453971..0ffb2a5 100644 --- a/dlls/jscript/tests/jscript.c +++ b/dlls/jscript/tests/jscript.c @@ -31,6 +31,8 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); static const CLSID CLSID_JScript = {0xf414c260,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}; +static const CLSID CLSID_JScriptEncode = + {0xf414c262,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}; #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE @@ -66,6 +68,8 @@ DEFINE_EXPECT(OnStateChange_INITIALIZED); DEFINE_EXPECT(OnEnterScript); DEFINE_EXPECT(OnLeaveScript); +static const CLSID *engine_clsid = &CLSID_JScript; + static BSTR a2bstr(const char *str) { BSTR ret; @@ -409,7 +413,7 @@ static IActiveScript *create_jscript(void) IActiveScript *ret; HRESULT hres; - hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, + hres = CoCreateInstance(engine_clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IActiveScript, (void**)&ret); ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); @@ -662,10 +666,15 @@ START_TEST(jscript) CoInitialize(NULL); if(check_jscript()) { + trace("Testing JScript object...\n"); test_jscript(); test_jscript2(); test_jscript_uninitializing(); test_aggregation(); + + trace("Testing JScriptEncode object...\n"); + engine_clsid = &CLSID_JScriptEncode; + test_jscript(); }else { win_skip("Broken engine, probably too old\n"); }
1
0
0
0
Jacek Caban : jscript: Added beginning support for JScriptEncode object.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: 4a9eea3516f750f5f99790d3b9cec160974fa847 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a9eea3516f750f5f99790d3b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 26 11:41:56 2012 +0200 jscript: Added beginning support for JScriptEncode object. --- dlls/jscript/jscript.c | 16 +++++----------- dlls/jscript/jscript.h | 2 +- dlls/jscript/jscript_main.c | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 5bd5db4..4674ffc 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -55,6 +55,7 @@ typedef struct { LONG thread_id; LCID lcid; DWORD version; + BOOL is_encode; IActiveScriptSite *site; @@ -1029,25 +1030,17 @@ static const IVariantChangeTypeVtbl VariantChangeTypeVtbl = { VariantChangeType_ChangeType }; -HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, - REFIID riid, void **ppv) +HRESULT create_jscript_object(BOOL is_encode, REFIID riid, void **ppv) { JScript *ret; HRESULT hres; - TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv); - - if(pUnkOuter) { - *ppv = NULL; - return CLASS_E_NOAGGREGATION; - } - - lock_module(); - ret = heap_alloc_zero(sizeof(*ret)); if(!ret) return E_OUTOFMEMORY; + lock_module(); + ret->IActiveScript_iface.lpVtbl = &JScriptVtbl; ret->IActiveScriptParse_iface.lpVtbl = &JScriptParseVtbl; ret->IActiveScriptParseProcedure2_iface.lpVtbl = &JScriptParseProcedureVtbl; @@ -1056,6 +1049,7 @@ HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUn ret->IVariantChangeType_iface.lpVtbl = &VariantChangeTypeVtbl; ret->ref = 1; ret->safeopt = INTERFACE_USES_DISPEX; + ret->is_encode = is_encode; hres = IActiveScript_QueryInterface(&ret->IActiveScript_iface, riid, ppv); IActiveScript_Release(&ret->IActiveScript_iface); diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 41085f1..a64de90 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -505,7 +505,7 @@ static inline BOOL is_jscript_error(HRESULT hres) const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN; -HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; +HRESULT create_jscript_object(BOOL,REFIID,void**) DECLSPEC_HIDDEN; extern LONG module_ref DECLSPEC_HIDDEN; diff --git a/dlls/jscript/jscript_main.c b/dlls/jscript/jscript_main.c index b97e258..c7419fc 100644 --- a/dlls/jscript/jscript_main.c +++ b/dlls/jscript/jscript_main.c @@ -83,6 +83,19 @@ static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock) return S_OK; } +static HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **ppv) +{ + TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv); + + if(outer) { + *ppv = NULL; + return CLASS_E_NOAGGREGATION; + } + + return create_jscript_object(FALSE, riid, ppv); +} + static const IClassFactoryVtbl JScriptFactoryVtbl = { ClassFactory_QueryInterface, ClassFactory_AddRef, @@ -93,6 +106,29 @@ static const IClassFactoryVtbl JScriptFactoryVtbl = { static IClassFactory JScriptFactory = { &JScriptFactoryVtbl }; +static HRESULT WINAPI JScriptEncodeFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **ppv) +{ + TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv); + + if(outer) { + *ppv = NULL; + return CLASS_E_NOAGGREGATION; + } + + return create_jscript_object(TRUE, riid, ppv); +} + +static const IClassFactoryVtbl JScriptEncodeFactoryVtbl = { + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + JScriptEncodeFactory_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory JScriptEncodeFactory = { &JScriptEncodeFactoryVtbl }; + /****************************************************************** * DllMain (jscript.@) */ @@ -123,6 +159,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) return IClassFactory_QueryInterface(&JScriptFactory, riid, ppv); } + if(IsEqualGUID(&CLSID_JScriptEncode, rclsid)) { + TRACE("(CLSID_JScriptEncode %s %p)\n", debugstr_guid(riid), ppv); + return IClassFactory_QueryInterface(&JScriptEncodeFactory, riid, ppv); + } + FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); return CLASS_E_CLASSNOTAVAILABLE; }
1
0
0
0
Jacek Caban : jscript: Store source code in bytecode_t.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: 0762106648a52883b21f07cb344b879d6a2b6e44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0762106648a52883b21f07cb3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Mar 26 11:41:38 2012 +0200 jscript: Store source code in bytecode_t. --- dlls/jscript/compile.c | 15 +++++++++++---- dlls/jscript/engine.h | 4 +++- dlls/jscript/parser.y | 9 +-------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index bb00aec..c9d814f 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1703,13 +1703,14 @@ void release_bytecode(bytecode_t *code) for(i=0; i < code->bstr_cnt; i++) SysFreeString(code->bstr_pool[i]); + heap_free(code->source); jsheap_free(&code->heap); heap_free(code->bstr_pool); heap_free(code->instrs); heap_free(code); } -static HRESULT init_code(compiler_ctx_t *compiler) +static HRESULT init_code(compiler_ctx_t *compiler, const WCHAR *source) { compiler->code = heap_alloc_zero(sizeof(bytecode_t)); if(!compiler->code) @@ -1718,6 +1719,12 @@ static HRESULT init_code(compiler_ctx_t *compiler) compiler->code->ref = 1; jsheap_init(&compiler->code->heap); + compiler->code->source = heap_strdupW(source); + if(!compiler->code->source) { + release_bytecode(compiler->code); + return E_OUTOFMEMORY; + } + compiler->code->instrs = heap_alloc(64 * sizeof(instr_t)); if(!compiler->code->instrs) { release_bytecode(compiler->code); @@ -1769,13 +1776,13 @@ HRESULT compile_script(script_ctx_t *ctx, const WCHAR *code, const WCHAR *delimi compiler_ctx_t compiler = {0}; HRESULT hres; - hres = script_parse(ctx, code, delimiter, from_eval, &compiler.parser); + hres = init_code(&compiler, code); if(FAILED(hres)) return hres; - hres = init_code(&compiler); + hres = script_parse(ctx, compiler.code->source, delimiter, from_eval, &compiler.parser); if(FAILED(hres)) { - parser_release(compiler.parser); + release_bytecode(compiler.code); return hres; } diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 040b3c4..64c0fea 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -43,7 +43,7 @@ typedef struct _func_stack { } func_stack_t; typedef struct { - WCHAR *begin; + const WCHAR *begin; const WCHAR *end; const WCHAR *ptr; @@ -172,6 +172,8 @@ typedef struct _bytecode_t { instr_t *instrs; jsheap_t heap; + WCHAR *source; + BSTR *bstr_pool; unsigned bstr_pool_size; unsigned bstr_cnt; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 717a95c..4eb3f1d 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1533,7 +1533,6 @@ static void program_parsed(parser_ctx_t *ctx, source_elements_t *source) void parser_release(parser_ctx_t *ctx) { script_release(ctx->script); - heap_free(ctx->begin); jsheap_free(&ctx->heap); heap_free(ctx); } @@ -1554,13 +1553,7 @@ HRESULT script_parse(script_ctx_t *ctx, const WCHAR *code, const WCHAR *delimite parser_ctx->hres = JS_E_SYNTAX; parser_ctx->is_html = delimiter && !strcmpiW(delimiter, html_tagW); - parser_ctx->begin = heap_strdupW(code); - if(!parser_ctx->begin) { - heap_free(parser_ctx); - return E_OUTOFMEMORY; - } - - parser_ctx->ptr = parser_ctx->begin; + parser_ctx->begin = parser_ctx->ptr = code; parser_ctx->end = parser_ctx->begin + strlenW(parser_ctx->begin); script_addref(ctx);
1
0
0
0
Henri Verbeet : ddraw: Make ddraw_surface_wined3d_parent_ops static.
by Alexandre Julliard
26 Mar '12
26 Mar '12
Module: wine Branch: master Commit: 6f35ec6092055bda229af9a95642d6541dbdfd44 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6f35ec6092055bda229af9a95…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Mar 25 20:56:31 2012 +0200 ddraw: Make ddraw_surface_wined3d_parent_ops static. --- dlls/ddraw/ddraw_private.h | 1 - dlls/ddraw/surface.c | 2 +- 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 2822585..700a781 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -37,7 +37,6 @@ #include "wine/list.h" #include "wine/wined3d.h" -extern const struct wined3d_parent_ops ddraw_surface_wined3d_parent_ops DECLSPEC_HIDDEN; extern const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops DECLSPEC_HIDDEN; /* Typdef the interfaces */ diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 8fc00e4..cca17ab 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -5585,7 +5585,7 @@ static void STDMETHODCALLTYPE ddraw_surface_wined3d_object_destroyed(void *paren HeapFree(GetProcessHeap(), 0, surface); } -const struct wined3d_parent_ops ddraw_surface_wined3d_parent_ops = +static const struct wined3d_parent_ops ddraw_surface_wined3d_parent_ops = { ddraw_surface_wined3d_object_destroyed, };
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200