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
September 2011
----- 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
996 discussions
Start a n
N
ew thread
Aurimas Fišeras : po: Update Lithuanian translation.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: 0032de57f7e0b4f2d4c437c608330cb81d053abd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0032de57f7e0b4f2d4c437c60…
Author: Aurimas Fišeras <aurimas(a)gmail.com> Date: Thu Sep 8 19:21:55 2011 +0300 po: Update Lithuanian translation. --- po/lt.po | 124 ++++++++++++++++++++++++++++++-------------------------------- 1 files changed, 60 insertions(+), 64 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0032de57f7e0b4f2d4c43…
1
0
0
0
Jörg Höhle : winealsa: Recommend Pulse users to upgrade to handle_underrun.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: 9c75a6aae5518357df464db7c352b27010dafff4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9c75a6aae5518357df464db7c…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Tue Aug 23 23:07:54 2011 +0200 winealsa: Recommend Pulse users to upgrade to handle_underrun. --- dlls/winealsa.drv/mmdevdrv.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 836d444..916c247 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -47,6 +47,7 @@ #include <alsa/asoundlib.h> WINE_DEFAULT_DEBUG_CHANNEL(alsa); +WINE_DECLARE_DEBUG_CHANNEL(winediag); #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) @@ -540,8 +541,11 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(const char *key, IMMDevice *dev, TRACE("Opening PCM device \"%s\" with handle_underrun: %d\n", key, err); snd_config_delete(lconf); /* Pulse <= 2010 returns EINVAL, it does not know handle_underrun. */ - if(err == -EINVAL) + if(err == -EINVAL){ + ERR_(winediag)("PulseAudio \"%s\" %d without handle_underrun. Audio may hang." + " Please upgrade to alsa_plugins >= 1.0.24\n", key, err); handle_underrun = 0; + } }else err = -EINVAL; if(err == -EINVAL){
1
0
0
0
Jörg Höhle : mmdevapi: Use UINT32 for a number of frames and UINT64 to sum them.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: 08dd823c7c12c4f4a97731c09dae8c9a9c634ac0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=08dd823c7c12c4f4a97731c09…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Tue Aug 16 19:53:35 2011 +0200 mmdevapi: Use UINT32 for a number of frames and UINT64 to sum them. --- dlls/winealsa.drv/mmdevdrv.c | 4 ++-- dlls/winecoreaudio.drv/mmdevdrv.c | 4 ++-- dlls/wineoss.drv/mmdevdrv.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index e471e2c..836d444 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -108,8 +108,8 @@ struct ACImpl { float *vols; BOOL initted, started; - UINT64 written_frames, held_frames, tmp_buffer_frames; - UINT32 bufsize_frames, period_us; + UINT64 written_frames; + UINT32 bufsize_frames, held_frames, tmp_buffer_frames, period_us; UINT32 lcl_offs_frames; /* offs into local_buffer where valid data starts */ HANDLE timer; diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 78daa8c..c1a3a3a 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -124,8 +124,8 @@ struct ACImpl { AudioQueueRef aqueue; AudioObjectPropertyScope scope; HANDLE timer; - UINT32 period_ms, bufsize_frames, inbuf_frames, written_frames; - UINT64 last_time; + UINT32 period_ms, bufsize_frames, inbuf_frames; + UINT64 last_time, written_frames; AudioQueueBufferRef public_buffer; UINT32 getbuf_last; int playing; diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index ed3e2ba..93f71cc 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -121,8 +121,8 @@ struct ACImpl { oss_audioinfo ai; BOOL initted, playing; - UINT64 written_frames, held_frames, tmp_buffer_frames, inbuf_frames; - UINT32 period_us, bufsize_frames; + UINT64 written_frames; + UINT32 period_us, bufsize_frames, held_frames, tmp_buffer_frames, inbuf_frames; UINT32 lcl_offs_frames; /* offs into local_buffer where valid data starts */ BYTE *local_buffer, *tmp_buffer;
1
0
0
0
Jacek Caban : vbscript: Added more tests.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: 1c1da3e596caaf226e4930e145e21f4e00e416d5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1c1da3e596caaf226e4930e14…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 8 14:58:32 2011 +0200 vbscript: Added more tests. --- dlls/vbscript/tests/Makefile.in | 2 + dlls/vbscript/tests/lang.vbs | 21 +++++++++ dlls/vbscript/tests/rsrc.rc | 20 +++++++++ dlls/vbscript/tests/run.c | 88 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+), 0 deletions(-) diff --git a/dlls/vbscript/tests/Makefile.in b/dlls/vbscript/tests/Makefile.in index a045f9c..3424612 100644 --- a/dlls/vbscript/tests/Makefile.in +++ b/dlls/vbscript/tests/Makefile.in @@ -5,4 +5,6 @@ C_SRCS = \ run.c \ vbscript.c +RC_SRCS = rsrc.rc + @MAKE_TEST_RULES@ diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs new file mode 100644 index 0000000..642c2ff --- /dev/null +++ b/dlls/vbscript/tests/lang.vbs @@ -0,0 +1,21 @@ +' +' Copyright 2011 Jacek Caban for CodeWeavers +' +' This library is free software; you can redistribute it and/or +' modify it under the terms of the GNU Lesser General Public +' License as published by the Free Software Foundation; either +' version 2.1 of the License, or (at your option) any later version. +' +' This library is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +' Lesser General Public License for more details. +' +' You should have received a copy of the GNU Lesser General Public +' License along with this library; if not, write to the Free Software +' Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +' + +call ok(true, "true is not true?") + +reportSuccess() diff --git a/dlls/vbscript/tests/rsrc.rc b/dlls/vbscript/tests/rsrc.rc new file mode 100644 index 0000000..834df1d --- /dev/null +++ b/dlls/vbscript/tests/rsrc.rc @@ -0,0 +1,20 @@ +/* + * Copyright 2011 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* @makedep: lang.vbs */ +lang.vbs 40 "lang.vbs" diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 6f1a967..b8cef40 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -60,10 +60,13 @@ DEFINE_EXPECT(global_success_d); DEFINE_EXPECT(global_success_i); #define DISPID_GLOBAL_REPORTSUCCESS 1000 +#define DISPID_GLOBAL_TRACE 1001 +#define DISPID_GLOBAL_OK 1002 static const WCHAR testW[] = {'t','e','s','t',0}; static BOOL strict_dispid_check; +static const char *test_name = "(null)"; static BSTR a2bstr(const char *str) { @@ -183,6 +186,16 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { + if(!strcmp_wa(bstrName, "ok")) { + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = DISPID_GLOBAL_OK; + return S_OK; + } + if(!strcmp_wa(bstrName, "trace")) { + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = DISPID_GLOBAL_TRACE; + return S_OK; + } if(!strcmp_wa(bstrName, "reportSuccess")) { CHECK_EXPECT(global_success_d); test_grfdex(grfdex, fdexNameCaseInsensitive); @@ -199,6 +212,48 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { switch(id) { + case DISPID_GLOBAL_OK: { + VARIANT *b; + + ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + if(wFlags & INVOKE_PROPERTYGET) + ok(pvarRes != NULL, "pvarRes == NULL\n"); + else + ok(!pvarRes, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); + + b = pdp->rgvarg+1; + if(V_VT(b) == (VT_BYREF|VT_VARIANT)) + b = V_BYREF(b); + + ok(V_VT(b) == VT_BOOL, "V_VT(b) = %d\n", V_VT(b)); + + ok(V_BOOL(b), "%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg))); + return S_OK; + } + + case DISPID_GLOBAL_TRACE: + ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(!pvarRes, "pvarRes != NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); + if(V_VT(pdp->rgvarg) == VT_BSTR) + trace("%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg))); + + return S_OK; case DISPID_GLOBAL_REPORTSUCCESS: CHECK_EXPECT(global_success_i); @@ -457,6 +512,37 @@ static void run_from_file(const char *filename) ok(hres == S_OK, "parse_script failed: %08x\n", hres); } +static void run_from_res(const char *name) +{ + const char *data; + DWORD size, len; + BSTR str; + HRSRC src; + HRESULT hres; + + strict_dispid_check = FALSE; + test_name = name; + + src = FindResourceA(NULL, name, (LPCSTR)40); + ok(src != NULL, "Could not find resource %s\n", name); + + size = SizeofResource(NULL, src); + data = LoadResource(NULL, src); + + len = MultiByteToWideChar(CP_ACP, 0, data, size, NULL, 0); + str = SysAllocStringLen(NULL, len); + MultiByteToWideChar(CP_ACP, 0, data, size, str, len); + + SET_EXPECT(global_success_d); + SET_EXPECT(global_success_i); + hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, str); + CHECK_CALLED(global_success_d); + CHECK_CALLED(global_success_i); + + ok(hres == S_OK, "parse_script failed: %08x\n", hres); + SysFreeString(str); +} + static void run_tests(void) { strict_dispid_check = TRUE; @@ -481,6 +567,8 @@ static void run_tests(void) parse_script_a("Call reportSuccess"); CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i); + + run_from_res("lang.vbs"); } static BOOL check_vbscript(void)
1
0
0
0
Jacek Caban : vbscript: Added support for arguments in interp_icallv.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: e7f582e89c4613c9869afb85044573a3b981b243 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e7f582e89c4613c9869afb850…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 8 14:58:15 2011 +0200 vbscript: Added support for arguments in interp_icallv. --- dlls/vbscript/interp.c | 36 +++++++++++++++++++++++++++++------- 1 files changed, 29 insertions(+), 7 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index d060c51..f5254c4 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -107,25 +107,46 @@ static void stack_popn(exec_ctx_t *ctx, unsigned n) VariantClear(stack_pop(ctx)); } +static void vbstack_to_dp(exec_ctx_t *ctx, unsigned arg_cnt, DISPPARAMS *dp) +{ + dp->cArgs = arg_cnt; + dp->rgdispidNamedArgs = NULL; + dp->cNamedArgs = 0; + + if(arg_cnt) { + VARIANT tmp; + unsigned i; + + assert(ctx->top >= arg_cnt); + + for(i=1; i*2 <= arg_cnt; i++) { + tmp = ctx->stack[ctx->top-i]; + ctx->stack[ctx->top-i] = ctx->stack[ctx->top-arg_cnt+i-1]; + ctx->stack[ctx->top-arg_cnt+i-1] = tmp; + } + + dp->rgvarg = ctx->stack + ctx->top-arg_cnt; + }else { + dp->rgvarg = NULL; + } +} + static HRESULT interp_icallv(exec_ctx_t *ctx) { BSTR identifier = ctx->instr->arg1.bstr; const unsigned arg_cnt = ctx->instr->arg2.uint; - DISPPARAMS dp = {0}; - ref_t ref; + ref_t ref = {0}; + DISPPARAMS dp; HRESULT hres; TRACE("\n"); - if(arg_cnt) { - FIXME("arguments not implemented\n"); - return E_NOTIMPL; - } - hres = lookup_identifier(ctx, identifier, &ref); if(FAILED(hres)) return hres; + vbstack_to_dp(ctx, arg_cnt, &dp); + switch(ref.type) { case REF_DISP: hres = disp_call(ctx->script, ref.u.d.disp, ref.u.d.id, &dp, NULL); @@ -137,6 +158,7 @@ static HRESULT interp_icallv(exec_ctx_t *ctx) return DISP_E_UNKNOWNNAME; } + stack_popn(ctx, arg_cnt); return S_OK; }
1
0
0
0
Jacek Caban : vbscript: Added interp_string implementation.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: 2cbbf5717940088f610bc2c891cfe75c4ac1d66b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2cbbf5717940088f610bc2c89…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 8 14:57:56 2011 +0200 vbscript: Added interp_string implementation. --- dlls/vbscript/interp.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index df296fa..d060c51 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -162,8 +162,16 @@ static HRESULT interp_bool(exec_ctx_t *ctx) static HRESULT interp_string(exec_ctx_t *ctx) { - FIXME("\n"); - return E_NOTIMPL; + VARIANT v; + + TRACE("\n"); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = SysAllocString(ctx->instr->arg1.str); + if(!V_BSTR(&v)) + return E_OUTOFMEMORY; + + return stack_push(ctx, &v); } static const instr_func_t op_funcs[] = {
1
0
0
0
Jacek Caban : vbscript: Added interp_bool implementation.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: 01e2bea114b88f2c5f45533b6a8f9367e573ab90 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=01e2bea114b88f2c5f45533b6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 8 14:57:45 2011 +0200 vbscript: Added interp_bool implementation. --- dlls/vbscript/interp.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 53 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index b498a91..df296fa 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -29,6 +29,10 @@ typedef struct { vbscode_t *code; instr_t *instr; script_ctx_t *script; + + unsigned stack_size; + unsigned top; + VARIANT *stack; } exec_ctx_t; typedef HRESULT (*instr_func_t)(exec_ctx_t*); @@ -72,6 +76,37 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, ref_t *ref) return S_OK; } +static inline VARIANT *stack_pop(exec_ctx_t *ctx) +{ + assert(ctx->top); + return ctx->stack + --ctx->top; +} + +static HRESULT stack_push(exec_ctx_t *ctx, VARIANT *v) +{ + if(ctx->stack_size == ctx->top) { + VARIANT *new_stack; + + new_stack = heap_realloc(ctx->stack, ctx->stack_size*2); + if(!new_stack) { + VariantClear(v); + return E_OUTOFMEMORY; + } + + ctx->stack = new_stack; + ctx->stack_size *= 2; + } + + ctx->stack[ctx->top++] = *v; + return S_OK; +} + +static void stack_popn(exec_ctx_t *ctx, unsigned n) +{ + while(n--) + VariantClear(stack_pop(ctx)); +} + static HRESULT interp_icallv(exec_ctx_t *ctx) { BSTR identifier = ctx->instr->arg1.bstr; @@ -115,8 +150,14 @@ static HRESULT interp_ret(exec_ctx_t *ctx) static HRESULT interp_bool(exec_ctx_t *ctx) { - FIXME("\n"); - return E_NOTIMPL; + const VARIANT_BOOL arg = ctx->instr->arg1.lng; + VARIANT v; + + TRACE("%s\n", arg ? "true" : "false"); + + V_VT(&v) = VT_BOOL; + V_BOOL(&v) = arg; + return stack_push(ctx, &v); } static HRESULT interp_string(exec_ctx_t *ctx) @@ -143,6 +184,12 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func) vbsop_t op; HRESULT hres = S_OK; + exec.stack_size = 16; + exec.top = 0; + exec.stack = heap_alloc(exec.stack_size * sizeof(VARIANT)); + if(!exec.stack) + return E_OUTOFMEMORY; + exec.code = func->code_ctx; exec.instr = exec.code->instrs + func->code_off; exec.script = ctx; @@ -152,11 +199,15 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func) hres = op_funcs[op](&exec); if(FAILED(hres)) { FIXME("Failed %08x\n", hres); + stack_popn(&exec, exec.top); break; } exec.instr += op_move[op]; } + assert(!exec.top); + heap_free(exec.stack); + return hres; }
1
0
0
0
Jacek Caban : vbscript: Added compiler support for string literals.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: ded37832fbe1951e52973f3afdd08bd808a6b0a9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ded37832fbe1951e52973f3af…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 8 14:57:31 2011 +0200 vbscript: Added compiler support for string literals. --- dlls/vbscript/compile.c | 14 ++++++++++++++ dlls/vbscript/interp.c | 6 ++++++ dlls/vbscript/vbscript.h | 3 ++- 3 files changed, 22 insertions(+), 1 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index cc3b683..7e8fe3b 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -73,6 +73,18 @@ static HRESULT push_instr_int(compile_ctx_t *ctx, vbsop_t op, LONG arg) return S_OK; } +static HRESULT push_instr_str(compile_ctx_t *ctx, vbsop_t op, const WCHAR *arg) +{ + unsigned ret; + + ret = push_instr(ctx, op); + if(ret == -1) + return E_OUTOFMEMORY; + + instr_ptr(ctx, ret)->arg1.str = arg; + return S_OK; +} + static BSTR alloc_bstr_arg(compile_ctx_t *ctx, const WCHAR *str) { if(!ctx->code->bstr_pool_size) { @@ -158,6 +170,8 @@ static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) switch(expr->type) { case EXPR_BOOL: return push_instr_int(ctx, OP_bool, ((bool_expression_t*)expr)->value); + case EXPR_STRING: + return push_instr_str(ctx, OP_string, ((string_expression_t*)expr)->value); default: FIXME("Unimplemented expression type %d\n", expr->type); return E_NOTIMPL; diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index a70a4dd..b498a91 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -119,6 +119,12 @@ static HRESULT interp_bool(exec_ctx_t *ctx) return E_NOTIMPL; } +static HRESULT interp_string(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + static const instr_func_t op_funcs[] = { #define X(x,n,a,b) interp_ ## x, OP_LIST diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index c0adc57..a1428bb 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -77,7 +77,8 @@ typedef enum { #define OP_LIST \ X(bool, 1, ARG_INT, 0) \ X(icallv, 1, ARG_BSTR, ARG_UINT) \ - X(ret, 0, 0, 0) + X(ret, 0, 0, 0) \ + X(string, 1, ARG_STR, 0) typedef enum { #define X(x,n,a,b) OP_##x,
1
0
0
0
Jacek Caban : vbscript: Added compiler support for boolean literals.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: 23c1fea07e5cf78c18db3876c24f00b9b2233ffa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=23c1fea07e5cf78c18db3876c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 8 14:57:16 2011 +0200 vbscript: Added compiler support for boolean literals. --- dlls/vbscript/compile.c | 60 ++++++++++++++++++++++++++++++++++++++++----- dlls/vbscript/interp.c | 12 +++++++++ dlls/vbscript/vbscript.h | 9 +++++- 3 files changed, 72 insertions(+), 9 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 49d933b..cc3b683 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -34,6 +34,8 @@ typedef struct { vbscode_t *code; } compile_ctx_t; +static HRESULT compile_expression(compile_ctx_t*,expression_t*); + static inline instr_t *instr_ptr(compile_ctx_t *ctx, unsigned id) { assert(id < ctx->instr_cnt); @@ -59,6 +61,18 @@ static unsigned push_instr(compile_ctx_t *ctx, vbsop_t op) return ctx->instr_cnt++; } +static HRESULT push_instr_int(compile_ctx_t *ctx, vbsop_t op, LONG arg) +{ + unsigned ret; + + ret = push_instr(ctx, op); + if(ret == -1) + return E_OUTOFMEMORY; + + instr_ptr(ctx, ret)->arg1.lng = arg; + return S_OK; +} + static BSTR alloc_bstr_arg(compile_ctx_t *ctx, const WCHAR *str) { if(!ctx->code->bstr_pool_size) { @@ -84,12 +98,12 @@ static BSTR alloc_bstr_arg(compile_ctx_t *ctx, const WCHAR *str) return ctx->code->bstr_pool[ctx->code->bstr_cnt++]; } -static HRESULT push_instr_bstr(compile_ctx_t *ctx, vbsop_t op, const WCHAR *arg) +static HRESULT push_instr_bstr_uint(compile_ctx_t *ctx, vbsop_t op, const WCHAR *arg1, unsigned arg2) { unsigned instr; BSTR bstr; - bstr = alloc_bstr_arg(ctx, arg); + bstr = alloc_bstr_arg(ctx, arg1); if(!bstr) return E_OUTOFMEMORY; @@ -98,28 +112,60 @@ static HRESULT push_instr_bstr(compile_ctx_t *ctx, vbsop_t op, const WCHAR *arg) return E_OUTOFMEMORY; instr_ptr(ctx, instr)->arg1.bstr = bstr; + instr_ptr(ctx, instr)->arg2.uint = arg2; return S_OK; } -static HRESULT compile_member_expression(compile_ctx_t *ctx, member_expression_t *expr) +static HRESULT compile_args(compile_ctx_t *ctx, expression_t *args, unsigned *ret) { + unsigned arg_cnt = 0; HRESULT hres; - if(expr->args) { - FIXME("arguments not implemented\n"); - return E_NOTIMPL; + while(args) { + hres = compile_expression(ctx, args); + if(FAILED(hres)) + return hres; + + arg_cnt++; + args = args->next; } + *ret = arg_cnt; + return S_OK; +} + +static HRESULT compile_member_expression(compile_ctx_t *ctx, member_expression_t *expr) +{ + unsigned arg_cnt = 0; + HRESULT hres; + + hres = compile_args(ctx, expr->args, &arg_cnt); + if(FAILED(hres)) + return hres; + if(expr->obj_expr) { FIXME("obj_expr not implemented\n"); hres = E_NOTIMPL; }else { - hres = push_instr_bstr(ctx, OP_icallv, expr->identifier); + hres = push_instr_bstr_uint(ctx, OP_icallv, expr->identifier, arg_cnt); } return hres; } +static HRESULT compile_expression(compile_ctx_t *ctx, expression_t *expr) +{ + switch(expr->type) { + case EXPR_BOOL: + return push_instr_int(ctx, OP_bool, ((bool_expression_t*)expr)->value); + default: + FIXME("Unimplemented expression type %d\n", expr->type); + return E_NOTIMPL; + } + + return S_OK; +} + static HRESULT compile_statement(compile_ctx_t *ctx, statement_t *stat) { HRESULT hres; diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index b309397..a70a4dd 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -75,12 +75,18 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, ref_t *ref) static HRESULT interp_icallv(exec_ctx_t *ctx) { BSTR identifier = ctx->instr->arg1.bstr; + const unsigned arg_cnt = ctx->instr->arg2.uint; DISPPARAMS dp = {0}; ref_t ref; HRESULT hres; TRACE("\n"); + if(arg_cnt) { + FIXME("arguments not implemented\n"); + return E_NOTIMPL; + } + hres = lookup_identifier(ctx, identifier, &ref); if(FAILED(hres)) return hres; @@ -107,6 +113,12 @@ static HRESULT interp_ret(exec_ctx_t *ctx) return S_OK; } +static HRESULT interp_bool(exec_ctx_t *ctx) +{ + FIXME("\n"); + return E_NOTIMPL; +} + static const instr_func_t op_funcs[] = { #define X(x,n,a,b) interp_ ## x, OP_LIST diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 8aca01c..c0adc57 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -69,11 +69,14 @@ HRESULT init_global(script_ctx_t*); typedef enum { ARG_NONE = 0, ARG_STR, - ARG_BSTR + ARG_BSTR, + ARG_INT, + ARG_UINT } instr_arg_type_t; #define OP_LIST \ - X(icallv, 1, ARG_BSTR, 0) \ + X(bool, 1, ARG_INT, 0) \ + X(icallv, 1, ARG_BSTR, ARG_UINT) \ X(ret, 0, 0, 0) typedef enum { @@ -86,6 +89,8 @@ OP_LIST typedef union { const WCHAR *str; BSTR bstr; + unsigned uint; + LONG lng; } instr_arg_t; typedef struct {
1
0
0
0
Jacek Caban : vbscript: Added parser support for string literals.
by Alexandre Julliard
08 Sep '11
08 Sep '11
Module: wine Branch: master Commit: dc73a7c4bba5e12eec196613e23b3967ad282bda URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc73a7c4bba5e12eec196613e…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Sep 8 14:56:58 2011 +0200 vbscript: Added parser support for string literals. --- dlls/vbscript/parse.h | 8 +++++++- dlls/vbscript/parser.y | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletions(-) diff --git a/dlls/vbscript/parse.h b/dlls/vbscript/parse.h index df337d2..a0c7f2c 100644 --- a/dlls/vbscript/parse.h +++ b/dlls/vbscript/parse.h @@ -18,7 +18,8 @@ typedef enum { EXPR_BOOL, - EXPR_MEMBER + EXPR_MEMBER, + EXPR_STRING } expression_type_t; typedef struct _expression_t { @@ -33,6 +34,11 @@ typedef struct { typedef struct { expression_t expr; + const WCHAR *value; +} string_expression_t; + +typedef struct { + expression_t expr; expression_t *obj_expr; const WCHAR *identifier; expression_t *args; diff --git a/dlls/vbscript/parser.y b/dlls/vbscript/parser.y index 06a0eb3..2d50565 100644 --- a/dlls/vbscript/parser.y +++ b/dlls/vbscript/parser.y @@ -36,6 +36,7 @@ static void parse_complete(parser_ctx_t*); static void source_add_statement(parser_ctx_t*,statement_t*); static expression_t *new_bool_expression(parser_ctx_t*,VARIANT_BOOL); +static expression_t *new_string_expression(parser_ctx_t*,const WCHAR*); static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*); @@ -113,6 +114,7 @@ Expression LiteralExpression : tTRUE { $$ = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; } | tFALSE { $$ = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; } + | tString { $$ = new_string_expression(ctx, $1); CHECK_ERROR; } %% @@ -161,6 +163,18 @@ static expression_t *new_bool_expression(parser_ctx_t *ctx, VARIANT_BOOL value) return &expr->expr; } +static expression_t *new_string_expression(parser_ctx_t *ctx, const WCHAR *value) +{ + string_expression_t *expr; + + expr = new_expression(ctx, EXPR_STRING, sizeof(*expr)); + if(!expr) + return NULL; + + expr->value = value; + return &expr->expr; +} + static member_expression_t *new_member_expression(parser_ctx_t *ctx, expression_t *obj_expr, const WCHAR *identifier) { member_expression_t *expr;
1
0
0
0
← Newer
1
...
71
72
73
74
75
76
77
...
100
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
95
96
97
98
99
100
Results per page:
10
25
50
100
200