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
June
May
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
October 2011
----- 2025 -----
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
783 discussions
Start a n
N
ew thread
Jacek Caban : shlwapi: Make sure we don' t write anything to output buffer if its size is too small to store the whole result .
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: 4a39433eaee04182a08277b8ca2f208b46a11212 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a39433eaee04182a08277b8c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Oct 14 17:29:51 2011 +0200 shlwapi: Make sure we don't write anything to output buffer if its size is too small to store the whole result. --- dlls/shlwapi/tests/url.c | 11 +++++++++++ dlls/shlwapi/url.c | 16 ++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c index 1ef2aab..29d0cff 100644 --- a/dlls/shlwapi/tests/url.c +++ b/dlls/shlwapi/tests/url.c @@ -882,16 +882,27 @@ static void test_UrlEscape(void) ok(size == 1, "got %d, expected %d\n", size, 1); size = 1; + empty_string[0] = 127; ret = pUrlEscapeA("/woningplan/woonkamer basis.swf", empty_string, &size, URL_ESCAPE_SPACES_ONLY); ok(ret == E_POINTER, "got %x, expected %x\n", ret, E_POINTER); ok(size == 34, "got %d, expected %d\n", size, 34); + ok(empty_string[0] == 127, "String has changed, empty_string[0] = %d\n", empty_string[0]); if(pUrlEscapeW) { + WCHAR wc; + size = sizeof(overwrite)/sizeof(WCHAR); ret = pUrlEscapeW(overwrite, overwrite, &size, URL_ESCAPE_SPACES_ONLY); ok(ret == S_OK, "got %x, expected S_OK\n", ret); ok(size == 9, "got %d, expected 9\n", size); ok(!lstrcmpW(overwrite, out), "got %s, expected %s\n", wine_dbgstr_w(overwrite), wine_dbgstr_w(out)); + + size = 1; + wc = 127; + ret = pUrlEscapeW(overwrite, &wc, &size, URL_ESCAPE_SPACES_ONLY); + ok(ret == E_POINTER, "got %x, expected %x\n", ret, E_POINTER); + ok(size == 10, "got %d, expected 9\n", size); + ok(wc == 127, "String has changed, wc = %d\n", wc); } for(i=0; i<sizeof(TEST_ESCAPE)/sizeof(TEST_ESCAPE[0]); i++) { diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 0c68529..bcd413c 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -1072,7 +1072,7 @@ HRESULT WINAPI UrlEscapeW( LPCWSTR src; DWORD needed = 0, ret; BOOL stop_escaping = FALSE; - WCHAR next[5], *dst = pszEscaped, *dst_ptr = NULL; + WCHAR next[5], *dst, *dst_ptr; INT len; PARSEDURLW parsed_url; DWORD int_flags; @@ -1091,11 +1091,9 @@ HRESULT WINAPI UrlEscapeW( URL_ESCAPE_PERCENT)) FIXME("Unimplemented flags: %08x\n", dwFlags); - if(pszUrl == pszEscaped) { - dst_ptr = dst = HeapAlloc(GetProcessHeap(), 0, *pcchEscaped*sizeof(WCHAR)); - if(!dst) - return E_OUTOFMEMORY; - } + dst_ptr = dst = HeapAlloc(GetProcessHeap(), 0, *pcchEscaped*sizeof(WCHAR)); + if(!dst_ptr) + return E_OUTOFMEMORY; /* fix up flags */ if (dwFlags & URL_ESCAPE_SPACES_ONLY) @@ -1213,8 +1211,7 @@ HRESULT WINAPI UrlEscapeW( if(needed < *pcchEscaped) { *dst = '\0'; - if(pszUrl == pszEscaped) - memcpy(pszEscaped, dst-needed, (needed+1)*sizeof(WCHAR)); + memcpy(pszEscaped, dst_ptr, (needed+1)*sizeof(WCHAR)); ret = S_OK; } else { @@ -1223,8 +1220,7 @@ HRESULT WINAPI UrlEscapeW( } *pcchEscaped = needed; - if(pszUrl == pszEscaped) - HeapFree(GetProcessHeap(), 0, dst_ptr); + HeapFree(GetProcessHeap(), 0, dst_ptr); return ret; }
1
0
0
0
Jacek Caban : vbscript: Added more releasing tests.
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: 01c4fed7b42f72983c3a6d0b1e28c21dd3d91cae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=01c4fed7b42f72983c3a6d0b1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Oct 14 16:22:33 2011 +0200 vbscript: Added more releasing tests. --- dlls/vbscript/tests/run.c | 132 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 131 insertions(+), 1 deletions(-) diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index 4fbf689..367ffea 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -74,6 +74,7 @@ DEFINE_EXPECT(testobj_propput_i); #define DISPID_GLOBAL_TESTOBJ 1006 #define DISPID_GLOBAL_ISNULLDISP 1007 #define DISPID_GLOBAL_TESTDISP 1008 +#define DISPID_GLOBAL_REFOBJ 1009 #define DISPID_TESTOBJ_PROPGET 2000 #define DISPID_TESTOBJ_PROPPUT 2001 @@ -342,6 +343,7 @@ static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, else return E_NOINTERFACE; + IUnknown_AddRef((IUnknown*)*ppv); return S_OK; } @@ -420,6 +422,19 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown return E_NOTIMPL; } +static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + static HRESULT WINAPI testObj_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { if(!strcmp_wa(bstrName, "propget")) { @@ -500,6 +515,38 @@ static IDispatchExVtbl testObjVtbl = { static IDispatchEx testObj = { &testObjVtbl }; +static ULONG refobj_ref; + +static ULONG WINAPI RefObj_AddRef(IDispatchEx *iface) +{ + return ++refobj_ref; +} + +static ULONG WINAPI RefObj_Release(IDispatchEx *iface) +{ + return --refobj_ref; +} + +static IDispatchExVtbl RefObjVtbl = { + DispatchEx_QueryInterface, + RefObj_AddRef, + RefObj_Release, + DispatchEx_GetTypeInfoCount, + DispatchEx_GetTypeInfo, + DispatchEx_GetIDsOfNames, + DispatchEx_Invoke, + DispatchEx_GetDispID, + DispatchEx_InvokeEx, + DispatchEx_DeleteMemberByName, + DispatchEx_DeleteMemberByDispID, + DispatchEx_GetMemberProperties, + DispatchEx_GetMemberName, + DispatchEx_GetNextDispID, + DispatchEx_GetNameSpaceParent +}; + +static IDispatchEx RefObj = { &RefObjVtbl }; + static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { if(!strcmp_wa(bstrName, "ok")) { @@ -549,6 +596,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD *pid = DISPID_GLOBAL_TESTDISP; return S_OK; } + if(!strcmp_wa(bstrName, "RefObj")) { + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = DISPID_GLOBAL_REFOBJ; + return S_OK; + } if(strict_dispid_check && strcmp_wa(bstrName, "x")) ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); @@ -679,6 +731,22 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, V_DISPATCH(pvarRes) = (IDispatch*)&testObj; return S_OK; + case DISPID_GLOBAL_REFOBJ: + ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags); + + ok(pdp != NULL, "pdp == NULL\n"); + ok(!pdp->rgvarg, "rgvarg == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pvarRes != NULL, "pvarRes == NULL\n"); + ok(pei != NULL, "pei == NULL\n"); + + IDispatchEx_AddRef(&RefObj); + V_VT(pvarRes) = VT_DISPATCH; + V_DISPATCH(pvarRes) = (IDispatch*)&RefObj; + return S_OK; + case DISPID_GLOBAL_ISNULLDISP: { VARIANT *v; @@ -850,6 +918,7 @@ static HRESULT parse_script(DWORD flags, BSTR script_str) IActiveScriptParse *parser; IActiveScript *engine; IDispatch *script_disp; + LONG ref; HRESULT hres; engine = create_script(); @@ -888,8 +957,9 @@ static HRESULT parse_script(DWORD flags, BSTR script_str) IDispatch_Release(script_disp); IActiveScript_Release(engine); - IUnknown_Release(parser); + ref = IUnknown_Release(parser); + ok(!ref, "ref=%d\n", ref); return hres; } @@ -964,6 +1034,63 @@ static void test_gc(void) IUnknown_Release(parser); } +static HRESULT test_global_vars_ref(BOOL use_close) +{ + IActiveScriptParse *parser; + IActiveScript *engine; + BSTR script_str; + LONG ref; + HRESULT hres; + + engine = create_script(); + if(!engine) + return S_OK; + + hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + if (FAILED(hres)) + { + IActiveScript_Release(engine); + return hres; + } + + hres = IActiveScriptParse64_InitNew(parser); + ok(hres == S_OK, "InitNew failed: %08x\n", hres); + + hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite); + ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + + hres = IActiveScript_AddNamedItem(engine, testW, SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS); + ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + + hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + + refobj_ref = 0; + + script_str = a2bstr("Dim x\nset x = RefObj\n"); + hres = IActiveScriptParse64_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + SysFreeString(script_str); + + ok(refobj_ref, "refobj_ref = 0\n"); + + if(use_close) { + hres = IActiveScript_Close(engine); + ok(hres == S_OK, "Close failed: %08x\n", hres); + }else { + hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_UNINITIALIZED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres); + } + + ok(!refobj_ref, "refobj_ref = %d\n", refobj_ref); + + IActiveScript_Release(engine); + + ref = IUnknown_Release(parser); + ok(!ref, "ref=%d\n", ref); + return hres; +} + static BSTR get_script_from_file(const char *filename) { DWORD size, len; @@ -1099,6 +1226,9 @@ static void run_tests(void) parse_script_a("x = 1\n Call ok(x = 1, \"x = \" & x)"); + test_global_vars_ref(TRUE); + test_global_vars_ref(FALSE); + strict_dispid_check = FALSE; parse_script_a("Sub testsub\n"
1
0
0
0
Jacek Caban : vbscript: Properly release global variables.
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: 6f0e215fb574ffe5891b717b5def2d08304430b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6f0e215fb574ffe5891b717b5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Oct 14 16:22:18 2011 +0200 vbscript: Properly release global variables. --- dlls/vbscript/interp.c | 9 +++++++++ dlls/vbscript/vbscript.c | 3 +++ dlls/vbscript/vbscript.h | 1 + 3 files changed, 13 insertions(+), 0 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 08bf710..f036557 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -1561,11 +1561,20 @@ OP_LIST #undef X }; +void release_dynamic_vars(dynamic_var_t *var) +{ + while(var) { + VariantClear(&var->v); + var = var->next; + } +} + static void release_exec(exec_ctx_t *ctx) { unsigned i; VariantClear(&ctx->ret_val); + release_dynamic_vars(ctx->dynamic_vars); if(ctx->this_obj) IDispatch_Release(ctx->this_obj); diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index ffaa63e..af037bd 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -114,6 +114,9 @@ static void release_script(script_ctx_t *ctx) { collect_objects(ctx); + release_dynamic_vars(ctx->global_vars); + ctx->global_vars = NULL; + while(!list_empty(&ctx->named_items)) { named_item_t *iter = LIST_ENTRY(list_head(&ctx->named_items), named_item_t, entry); diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 9e18f47..890c7c7 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -309,6 +309,7 @@ struct _vbscode_t { void release_vbscode(vbscode_t*) DECLSPEC_HIDDEN; HRESULT compile_script(script_ctx_t*,const WCHAR*,vbscode_t**) DECLSPEC_HIDDEN; HRESULT exec_script(script_ctx_t*,function_t*,IDispatch*,DISPPARAMS*,VARIANT*) DECLSPEC_HIDDEN; +void release_dynamic_vars(dynamic_var_t*) DECLSPEC_HIDDEN; #define TID_LIST \ XDIID(ErrObj) \
1
0
0
0
Jacek Caban : vbscript: Added more script state tests.
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: 84d5a39659144c3a25610a7ec7bf86d5e2afcd2b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84d5a39659144c3a25610a7ec…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Oct 14 16:22:04 2011 +0200 vbscript: Added more script state tests. --- dlls/vbscript/tests/vbscript.c | 121 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 121 insertions(+), 0 deletions(-) diff --git a/dlls/vbscript/tests/vbscript.c b/dlls/vbscript/tests/vbscript.c index 6ead8f4..431f815 100644 --- a/dlls/vbscript/tests/vbscript.c +++ b/dlls/vbscript/tests/vbscript.c @@ -471,12 +471,130 @@ static void test_vbscript_uninitializing(void) test_state(script, SCRIPTSTATE_CLOSED); + SET_EXPECT(GetLCID); + SET_EXPECT(OnStateChange_INITIALIZED); + hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); + ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + CHECK_CALLED(GetLCID); + CHECK_CALLED(OnStateChange_INITIALIZED); + + test_state(script, SCRIPTSTATE_INITIALIZED); + + SET_EXPECT(OnStateChange_CLOSED); + hres = IActiveScript_Close(script); + ok(hres == S_OK, "Close failed: %08x\n", hres); + CHECK_CALLED(OnStateChange_CLOSED); + + test_state(script, SCRIPTSTATE_CLOSED); + IUnknown_Release(parse); ref = IActiveScript_Release(script); ok(!ref, "ref = %d\n", ref); } +static void test_vbscript_release(void) +{ + IActiveScriptParse *parser; + IActiveScript *vbscript; + ULONG ref; + HRESULT hres; + + vbscript = create_vbscript(); + + hres = IActiveScript_QueryInterface(vbscript, &IID_IActiveScriptParse, (void**)&parser); + ok(hres == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hres); + + test_state(vbscript, SCRIPTSTATE_UNINITIALIZED); + test_safety(vbscript); + + SET_EXPECT(GetLCID); + hres = IActiveScript_SetScriptSite(vbscript, &ActiveScriptSite); + ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + CHECK_CALLED(GetLCID); + + test_state(vbscript, SCRIPTSTATE_UNINITIALIZED); + + SET_EXPECT(OnStateChange_INITIALIZED); + hres = IActiveScriptParse64_InitNew(parser); + ok(hres == S_OK, "InitNew failed: %08x\n", hres); + CHECK_CALLED(OnStateChange_INITIALIZED); + + test_state(vbscript, SCRIPTSTATE_INITIALIZED); + + SET_EXPECT(OnStateChange_CONNECTED); + hres = IActiveScript_SetScriptState(vbscript, SCRIPTSTATE_CONNECTED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres); + CHECK_CALLED(OnStateChange_CONNECTED); + + test_state(vbscript, SCRIPTSTATE_CONNECTED); + + IActiveScriptParse64_Release(parser); + + SET_EXPECT(OnStateChange_DISCONNECTED); + SET_EXPECT(OnStateChange_INITIALIZED); + SET_EXPECT(OnStateChange_CLOSED); + ref = IActiveScript_Release(vbscript); + ok(!ref, "ref = %d\n", ref); + CHECK_CALLED(OnStateChange_DISCONNECTED); + CHECK_CALLED(OnStateChange_INITIALIZED); + CHECK_CALLED(OnStateChange_CLOSED); +} + +static void test_vbscript_simplecreate(void) +{ + IActiveScript *script; + ULONG ref; + HRESULT hres; + + script = create_vbscript(); + + hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED); + ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres); + + ref = IActiveScript_Release(script); + ok(!ref, "ref = %d\n", ref); +} + +static void test_vbscript_initializing(void) +{ + IActiveScriptParse *parse; + IActiveScript *script; + ULONG ref; + HRESULT hres; + + script = create_vbscript(); + + hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse); + ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres); + + test_state(script, SCRIPTSTATE_UNINITIALIZED); + + SET_EXPECT(GetLCID); + hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); + ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); + CHECK_CALLED(GetLCID); + + SET_EXPECT(OnStateChange_INITIALIZED); + hres = IActiveScriptParse64_InitNew(parse); + ok(hres == S_OK, "InitNew failed: %08x\n", hres); + CHECK_CALLED(OnStateChange_INITIALIZED); + + hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); + ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08x, expected E_UNEXPECTED\n", hres); + + SET_EXPECT(OnStateChange_CLOSED); + hres = IActiveScript_Close(script); + ok(hres == S_OK, "Close failed: %08x\n", hres); + CHECK_CALLED(OnStateChange_CLOSED); + + test_state(script, SCRIPTSTATE_CLOSED); + + IUnknown_Release(parse); + + ref = IActiveScript_Release(script); + ok(!ref, "ref = %d\n", ref); +} static BOOL check_vbscript(void) { @@ -498,6 +616,9 @@ START_TEST(vbscript) if(check_vbscript()) { test_vbscript(); test_vbscript_uninitializing(); + test_vbscript_release(); + test_vbscript_simplecreate(); + test_vbscript_initializing(); }else { win_skip("VBScript engine not available\n"); }
1
0
0
0
Jacek Caban : vbscript: Keep script context alive after Close call, but make it reusable.
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: b1c7f544ed638a9c819a935ad8988bf28b70be7c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b1c7f544ed638a9c819a935ad…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Oct 14 16:21:52 2011 +0200 vbscript: Keep script context alive after Close call, but make it reusable. --- dlls/vbscript/vbscript.c | 62 +++++++++++++++++++++++++++++++++------------ 1 files changed, 45 insertions(+), 17 deletions(-) diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index 7bea9f2b..ffaa63e 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -110,13 +110,10 @@ static HRESULT set_ctx_site(VBScript *This) return S_OK; } -static void destroy_script(script_ctx_t *ctx) +static void release_script(script_ctx_t *ctx) { collect_objects(ctx); - while(!list_empty(&ctx->code_list)) - release_vbscode(LIST_ENTRY(list_head(&ctx->code_list), vbscode_t, entry)); - while(!list_empty(&ctx->named_items)) { named_item_t *iter = LIST_ENTRY(list_head(&ctx->named_items), named_item_t, entry); @@ -127,19 +124,46 @@ static void destroy_script(script_ctx_t *ctx) heap_free(iter); } - if(ctx->host_global) + if(ctx->host_global) { IDispatch_Release(ctx->host_global); - if(ctx->secmgr) + ctx->host_global = NULL; + } + + if(ctx->secmgr) { IInternetHostSecurityManager_Release(ctx->secmgr); - if(ctx->site) + ctx->secmgr = NULL; + } + + if(ctx->site) { IActiveScriptSite_Release(ctx->site); - if(ctx->err_obj) + ctx->site = NULL; + } + + if(ctx->err_obj) { IDispatchEx_Release(&ctx->err_obj->IDispatchEx_iface); - if(ctx->global_obj) + ctx->err_obj = NULL; + } + + if(ctx->global_obj) { IDispatchEx_Release(&ctx->global_obj->IDispatchEx_iface); - if(ctx->script_obj) + ctx->global_obj = NULL; + } + + if(ctx->script_obj) { IDispatchEx_Release(&ctx->script_obj->IDispatchEx_iface); + ctx->script_obj = NULL; + } + vbsheap_free(&ctx->heap); + vbsheap_init(&ctx->heap); +} + +static void destroy_script(script_ctx_t *ctx) +{ + while(!list_empty(&ctx->code_list)) + release_vbscode(LIST_ENTRY(list_head(&ctx->code_list), vbscode_t, entry)); + + release_script(ctx); heap_free(ctx); } @@ -167,13 +191,12 @@ static void decrease_state(VBScript *This, SCRIPTSTATE state) This->site = NULL; } - This->thread_id = 0; - - if(state == SCRIPTSTATE_CLOSED) { - destroy_script(This->ctx); - This->ctx = NULL; - } + if(This->ctx) + release_script(This->ctx); + This->thread_id = 0; + break; + case SCRIPTSTATE_CLOSED: break; default: assert(0); @@ -229,6 +252,11 @@ static ULONG WINAPI VBScript_Release(IActiveScript *iface) TRACE("(%p) ref=%d\n", iface, ref); if(!ref) { + if(This->ctx) { + decrease_state(This, SCRIPTSTATE_CLOSED); + destroy_script(This->ctx); + This->ctx = NULL; + } if(This->site) IActiveScriptSite_Release(This->site); heap_free(This); @@ -413,7 +441,7 @@ static HRESULT WINAPI VBScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR if(!ppdisp) return E_POINTER; - if(This->thread_id != GetCurrentThreadId() || !This->ctx->script_obj) { + if(This->thread_id != GetCurrentThreadId() || !This->ctx || !This->ctx->script_obj) { *ppdisp = NULL; return E_UNEXPECTED; }
1
0
0
0
Alexandre Julliard : gdi32: Overlapping rectangles are not allowed in GdiAlphaBlend.
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: b7a15ae7faa0541bbaf55074413e4c176ed4f852 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b7a15ae7faa0541bbaf550744…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Oct 14 18:22:50 2011 +0200 gdi32: Overlapping rectangles are not allowed in GdiAlphaBlend. --- dlls/gdi32/bitblt.c | 8 ++++++++ dlls/gdi32/tests/bitmap.c | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/bitblt.c b/dlls/gdi32/bitblt.c index e03a5c1..eee6fa2 100644 --- a/dlls/gdi32/bitblt.c +++ b/dlls/gdi32/bitblt.c @@ -774,6 +774,14 @@ BOOL WINAPI GdiAlphaBlend(HDC hdcDst, int xDst, int yDst, int widthDst, int heig SetLastError( ERROR_INVALID_PARAMETER ); ret = FALSE; } + else if (dcSrc == dcDst && src.x + src.width > dst.x && src.x < dst.x + dst.width && + src.y + src.height > dst.y && src.y < dst.y + dst.height) + { + WARN( "Overlapping coords: (%d,%d), %dx%d and (%d,%d), %dx%d\n", + src.x, src.y, src.width, src.height, dst.x, dst.y, dst.width, dst.height ); + SetLastError( ERROR_INVALID_PARAMETER ); + ret = FALSE; + } else if (!ret) ret = dst_dev->funcs->pAlphaBlend( dst_dev, &dst, src_dev, &src, blendFunction ); release_dc_ptr( dcDst ); diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index e069fa8..32fabb8 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -3279,6 +3279,25 @@ static void test_GdiAlphaBlend(void) ok( !ret, "GdiAlphaBlend succeeded\n" ); ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); + /* overlapping source and dest not allowed */ + + SetLastError(0xdeadbeef); + ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcDst, 19, 19, 20, 20, blend); + ok( !ret, "GdiAlphaBlend succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + SetLastError(0xdeadbeef); + ret = pGdiAlphaBlend(hdcDst, 20, 20, 20, 20, hdcDst, 1, 1, 20, 20, blend); + ok( !ret, "GdiAlphaBlend succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + SetLastError(0xdeadbeef); + ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcDst, 20, 10, 20, 20, blend); + ok( ret, "GdiAlphaBlend succeeded\n" ); + SetLastError(0xdeadbeef); + ret = pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcDst, 10, 20, 20, 20, blend); + ok( ret, "GdiAlphaBlend succeeded\n" ); + /* AC_SRC_ALPHA requires 32-bpp BI_RGB format */ blend.AlphaFormat = AC_SRC_ALPHA;
1
0
0
0
Frédéric Delanoy : cmd: Make RENAME work for read-only files.
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: 6fd9d774268fe2b9e4f3fecbbbcf29f8a87218c2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6fd9d774268fe2b9e4f3fecbb…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Oct 14 15:37:59 2011 +0200 cmd: Make RENAME work for read-only files. --- programs/cmd/builtins.c | 15 +++------------ programs/cmd/tests/test_builtins.cmd.exp | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index ed2b6f0..5a890c7 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -1768,8 +1768,8 @@ void WCMD_remove_dir (WCHAR *command) { * Rename a file. */ -void WCMD_rename (void) { - +void WCMD_rename (void) +{ int status; HANDLE hff; WIN32_FIND_DATAW fd; @@ -1779,7 +1779,6 @@ void WCMD_rename (void) { WCHAR dir[MAX_PATH]; WCHAR fname[MAX_PATH]; WCHAR ext[MAX_PATH]; - DWORD attribs; errorlevel = 0; @@ -1853,15 +1852,7 @@ void WCMD_rename (void) { WINE_TRACE("Source '%s'\n", wine_dbgstr_w(src)); WINE_TRACE("Dest '%s'\n", wine_dbgstr_w(dest)); - /* Check if file is read only, otherwise move it */ - attribs = GetFileAttributesW(src); - if ((attribs != INVALID_FILE_ATTRIBUTES) && - (attribs & FILE_ATTRIBUTE_READONLY)) { - SetLastError(ERROR_ACCESS_DENIED); - status = 0; - } else { - status = MoveFileW(src, dest); - } + status = MoveFileW(src, dest); if (!status) { WCMD_print_error (); diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index eaefdc1..20e5d12 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -602,7 +602,7 @@ bar renamed to foo foo bar ... rename read-only files ... -@todo_wine@read-only file renamed +read-only file renamed ... rename directories ... dir renamed read-only dir renamed
1
0
0
0
Frédéric Delanoy : cmd/tests: Show that read-only files are RENAMEable.
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: d5523fcd8090cf39506eb38d33eea074195aafbe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d5523fcd8090cf39506eb38d3…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Oct 14 15:37:58 2011 +0200 cmd/tests: Show that read-only files are RENAMEable. --- programs/cmd/tests/test_builtins.cmd | 11 +++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 2 ++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index b68e697..02e264d 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -899,6 +899,17 @@ rem no-op ren foo foo mkdir baz ren foo baz\abc +echo ... rename read-only files ... +echo > file1 +attrib +r file1 +ren file1 file2 +if not exist file1 ( + if exist file2 ( + echo read-only file renamed + ) +) else ( + echo read-only file not renamed! +) echo ... rename directories ... mkdir rep1 ren rep1 rep2 diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 5371246..eaefdc1 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -601,6 +601,8 @@ bar renamed to foo ... name collision ... foo bar +... rename read-only files ... +@todo_wine@read-only file renamed ... rename directories ... dir renamed read-only dir renamed
1
0
0
0
Frédéric Delanoy : cmd/tests: Add tests for directories RENAMEs.
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: 1f5c0a6170a14306ba350019b55a63e9d1619e9d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1f5c0a6170a14306ba350019b…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Oct 14 15:37:57 2011 +0200 cmd/tests: Add tests for directories RENAMEs. --- programs/cmd/tests/test_builtins.cmd | 15 +++++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 3 +++ 2 files changed, 18 insertions(+), 0 deletions(-) diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index 1967e42..b68e697 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -899,6 +899,21 @@ rem no-op ren foo foo mkdir baz ren foo baz\abc +echo ... rename directories ... +mkdir rep1 +ren rep1 rep2 +if not exist rep1 ( + if exist rep2 ( + echo dir renamed + ) +) +attrib +r rep2 +ren rep2 rep1 +if not exist rep2 ( + if exist rep1 ( + echo read-only dir renamed + ) +) echo ... rename in other directory ... if not exist baz\abc ( echo rename impossible in other directory diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index e45016c..5371246 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -601,6 +601,9 @@ bar renamed to foo ... name collision ... foo bar +... rename directories ... +dir renamed +read-only dir renamed ... rename in other directory ... @todo_wine@rename impossible in other directory @todo_wine@original file still present
1
0
0
0
Frédéric Delanoy : inetmib1: Avoid idempotent operation in findSupportedQuery function (Clang).
by Alexandre Julliard
14 Oct '11
14 Oct '11
Module: wine Branch: master Commit: 699fb02d101d708b52cd8904f82ab455c9b00a4e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=699fb02d101d708b52cd8904f…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Oct 14 13:02:35 2011 +0200 inetmib1: Avoid idempotent operation in findSupportedQuery function (Clang). --- dlls/inetmib1/main.c | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/dlls/inetmib1/main.c b/dlls/inetmib1/main.c index 76741f3..af9f17c 100644 --- a/dlls/inetmib1/main.c +++ b/dlls/inetmib1/main.c @@ -1342,29 +1342,26 @@ static void cleanup(void) static struct mibImplementation *findSupportedQuery(UINT *ids, UINT idLength, UINT *matchingIndex) { - int indexHigh = DEFINE_SIZEOF(supportedIDs) - 1, indexLow = 0, i; - struct mibImplementation *impl = NULL; + int indexHigh = DEFINE_SIZEOF(supportedIDs) - 1, indexLow = 0; AsnObjectIdentifier oid1 = { idLength, ids}; if (!idLength) return NULL; - for (i = (indexLow + indexHigh) / 2; !impl && indexLow <= indexHigh; - i = (indexLow + indexHigh) / 2) - { - INT cmp; - cmp = SnmpUtilOidNCmp(&oid1, &supportedIDs[i].name, idLength); - if (!cmp) + while (indexLow <= indexHigh) + { + INT cmp, i = (indexLow + indexHigh) / 2; + if (!(cmp = SnmpUtilOidNCmp(&oid1, &supportedIDs[i].name, idLength))) { - impl = &supportedIDs[i]; *matchingIndex = i; + return &supportedIDs[i]; } - else if (cmp > 0) + if (cmp > 0) indexLow = i + 1; else indexHigh = i - 1; } - return impl; + return NULL; } /*****************************************************************************
1
0
0
0
← Newer
1
...
42
43
44
45
46
47
48
...
79
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
Results per page:
10
25
50
100
200