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 2020
----- 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
1 participants
996 discussions
Start a n
N
ew thread
Gabriel Ivăncescu : vbscript/tests: Add tests for persistent named items.
by Alexandre Julliard
20 Mar '20
20 Mar '20
Module: wine Branch: master Commit: 4badb89c5f166f3fa542a8b95be1a72809d380be URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4badb89c5f166f3fa542a8b9…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Mar 19 19:20:17 2020 +0200 vbscript/tests: Add tests for persistent named items. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/tests/vbscript.c | 84 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 5 deletions(-) diff --git a/dlls/vbscript/tests/vbscript.c b/dlls/vbscript/tests/vbscript.c index 86534632f0..7545ca3e86 100644 --- a/dlls/vbscript/tests/vbscript.c +++ b/dlls/vbscript/tests/vbscript.c @@ -101,6 +101,7 @@ DEFINE_EXPECT(GetItemInfo_global); DEFINE_EXPECT(GetItemInfo_global_code); DEFINE_EXPECT(GetItemInfo_visible); DEFINE_EXPECT(GetItemInfo_visible_code); +DEFINE_EXPECT(GetItemInfo_persistent); DEFINE_EXPECT(testCall); DEFINE_GUID(CLSID_VBScript, 0xb54f3741, 0x5b07, 0x11cf, 0xa4,0xb0, 0x00,0xaa,0x00,0x4a,0x55,0xe8); @@ -151,7 +152,7 @@ static ULONG WINAPI Dispatch_Release(IDispatch *iface) return 1; } -static ULONG global_named_item_ref, visible_named_item_ref, visible_code_named_item_ref; +static ULONG global_named_item_ref, visible_named_item_ref, visible_code_named_item_ref, persistent_named_item_ref; static ULONG WINAPI global_AddRef(IDispatch *iface) { @@ -183,6 +184,16 @@ static ULONG WINAPI visible_code_Release(IDispatch *iface) return --visible_code_named_item_ref; } +static ULONG WINAPI persistent_AddRef(IDispatch *iface) +{ + return ++persistent_named_item_ref; +} + +static ULONG WINAPI persistent_Release(IDispatch *iface) +{ + return --persistent_named_item_ref; +} + static HRESULT WINAPI Dispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo) { ok(0, "unexpected call\n"); @@ -266,6 +277,18 @@ static const IDispatchVtbl visible_code_named_item_vtbl = { static IDispatch visible_code_named_item = { &visible_code_named_item_vtbl }; +static const IDispatchVtbl persistent_named_item_vtbl = { + Dispatch_QueryInterface, + persistent_AddRef, + persistent_Release, + Dispatch_GetTypeInfoCount, + Dispatch_GetTypeInfo, + Dispatch_GetIDsOfNames, + Dispatch_Invoke +}; + +static IDispatch persistent_named_item = { &persistent_named_item_vtbl }; + static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv) { *ppv = NULL; @@ -325,6 +348,12 @@ static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPC *item_unk = (IUnknown*)&visible_code_named_item; return S_OK; } + if(!wcscmp(name, L"persistent")) { + CHECK_EXPECT(GetItemInfo_persistent); + IDispatch_AddRef(&persistent_named_item); + *item_unk = (IUnknown*)&persistent_named_item; + return S_OK; + } ok(0, "unexpected call %s\n", wine_dbgstr_w(name)); return E_NOTIMPL; } @@ -1818,6 +1847,8 @@ static void test_named_items(void) ok(hres == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hres); hres = IActiveScript_AddNamedItem(script, L"codeOnlyItem", SCRIPTITEM_CODEONLY); ok(hres == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hres); + hres = IActiveScript_AddNamedItem(script, L"persistent", SCRIPTITEM_ISPERSISTENT | SCRIPTITEM_CODEONLY); + ok(hres == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hres); SET_EXPECT(GetLCID); hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); @@ -1835,10 +1866,13 @@ static void test_named_items(void) ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); hres = IActiveScript_AddNamedItem(script, L"codeOnlyItem", SCRIPTITEM_CODEONLY); ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); + hres = IActiveScript_AddNamedItem(script, L"persistent", SCRIPTITEM_ISPERSISTENT | SCRIPTITEM_CODEONLY); + ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); ok(global_named_item_ref > 0, "global_named_item_ref = %u\n", global_named_item_ref); ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref); ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref); + ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); hres = IActiveScript_GetScriptDispatch(script, L"noContext", &disp); ok(hres == E_INVALIDARG, "GetScriptDispatch returned: %08x\n", hres); @@ -1920,6 +1954,7 @@ static void test_named_items(void) ok(global_named_item_ref > 0, "global_named_item_ref = %u\n", global_named_item_ref); ok(visible_named_item_ref == 1, "visible_named_item_ref = %u\n", visible_named_item_ref); ok(visible_code_named_item_ref == 1, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref); + ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); SET_EXPECT(testCall); parse_script(parse, "visibleItem.testCall\n"); @@ -2087,6 +2122,28 @@ static void test_named_items(void) IDispatchEx_Release(script_disp2); IDispatchEx_Release(script_disp); + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + hres = IActiveScriptParse_ParseScriptText(parse, L"x = 13\n", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + hres = IActiveScriptParse_ParseScriptText(parse, L"x = 10\n", L"persistent", NULL, NULL, 0, 0, 0, NULL, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + hres = IActiveScriptParse_ParseScriptText(parse, L"x", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_I2 && V_I2(&var) == 10, "Unexpected 'x': V_VT = %d, V_I2 = %d\n", V_VT(&var), V_I2(&var)); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + + script_disp = get_script_dispatch(script, L"persistent"); + SET_EXPECT(OnStateChange_DISCONNECTED); SET_EXPECT(OnStateChange_INITIALIZED); SET_EXPECT(OnStateChange_UNINITIALIZED); @@ -2100,30 +2157,46 @@ static void test_named_items(void) ok(global_named_item_ref == 0, "global_named_item_ref = %u\n", global_named_item_ref); ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref); ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref); + ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); hres = IActiveScript_GetScriptDispatch(script, L"codeOnlyItem", &disp); ok(hres == E_UNEXPECTED, "hres = %08x, expected E_UNEXPECTED\n", hres); SET_EXPECT(GetLCID); SET_EXPECT(OnStateChange_INITIALIZED); + SET_EXPECT(GetItemInfo_persistent); hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite); ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres); CHECK_CALLED(GetLCID); CHECK_CALLED(OnStateChange_INITIALIZED); + CHECK_CALLED(GetItemInfo_persistent); + ok(persistent_named_item_ref > 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); hres = IActiveScript_AddNamedItem(script, L"codeOnlyItem", SCRIPTITEM_CODEONLY); ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres); SET_EXPECT(OnStateChange_CONNECTED); - SET_EXPECT_MULTI(OnEnterScript, 4); - SET_EXPECT_MULTI(OnLeaveScript, 4); + SET_EXPECT_MULTI(OnEnterScript, 5); + SET_EXPECT_MULTI(OnLeaveScript, 5); hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED); ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres); CHECK_CALLED(OnStateChange_CONNECTED); - CHECK_CALLED_MULTI(OnEnterScript, 4); - CHECK_CALLED_MULTI(OnLeaveScript, 4); + CHECK_CALLED_MULTI(OnEnterScript, 5); + CHECK_CALLED_MULTI(OnLeaveScript, 5); test_state(script, SCRIPTSTATE_CONNECTED); + script_disp2 = get_script_dispatch(script, L"persistent"); + ok(script_disp != script_disp2, "Same script dispatch returned for \"persistent\" named item\n"); + IDispatchEx_Release(script_disp2); + IDispatchEx_Release(script_disp); + SET_EXPECT(OnEnterScript); + SET_EXPECT(OnLeaveScript); + hres = IActiveScriptParse_ParseScriptText(parse, L"x", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL); + ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres); + ok(V_VT(&var) == VT_I2 && V_I2(&var) == 13, "Unexpected 'x': V_VT = %d, V_I2 = %d\n", V_VT(&var), V_I2(&var)); + CHECK_CALLED(OnEnterScript); + CHECK_CALLED(OnLeaveScript); + script_disp = get_script_dispatch(script, NULL); for (i = 0; i < ARRAY_SIZE(global_idents); i++) { @@ -2237,6 +2310,7 @@ static void test_named_items(void) ok(global_named_item_ref == 0, "global_named_item_ref = %u\n", global_named_item_ref); ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref); ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref); + ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref); test_state(script, SCRIPTSTATE_CLOSED);
1
0
0
0
Gabriel Ivăncescu : vbscript: Implement persistent named items.
by Alexandre Julliard
20 Mar '20
20 Mar '20
Module: wine Branch: master Commit: 4b92d1943a645e3518a3b66012a1c57ae56e75d1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4b92d1943a645e3518a3b660…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Mar 19 19:20:16 2020 +0200 vbscript: Implement persistent named items. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/vbscript.c | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index 52bc4ffd0d..858cacb7c3 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -262,6 +262,7 @@ void release_named_item(named_item_t *item) static void release_script(script_ctx_t *ctx) { + named_item_t *item, *item_next; vbscode_t *code, *code_next; collect_objects(ctx); @@ -282,14 +283,19 @@ static void release_script(script_ctx_t *ctx) } } - while(!list_empty(&ctx->named_items)) { - named_item_t *iter = LIST_ENTRY(list_head(&ctx->named_items), named_item_t, entry); - - list_remove(&iter->entry); - if(iter->disp) - IDispatch_Release(iter->disp); - release_named_item_script_obj(iter); - release_named_item(iter); + LIST_FOR_EACH_ENTRY_SAFE(item, item_next, &ctx->named_items, named_item_t, entry) + { + if(item->disp) + { + IDispatch_Release(item->disp); + item->disp = NULL; + } + release_named_item_script_obj(item); + if(!(item->flags & SCRIPTITEM_ISPERSISTENT)) + { + list_remove(&item->entry); + release_named_item(item); + } } if(ctx->secmgr) { @@ -321,6 +327,15 @@ static void release_code_list(script_ctx_t *ctx) } } +static void release_named_item_list(script_ctx_t *ctx) +{ + while(!list_empty(&ctx->named_items)) { + named_item_t *iter = LIST_ENTRY(list_head(&ctx->named_items), named_item_t, entry); + list_remove(&iter->entry); + release_named_item(iter); + } +} + static void decrease_state(VBScript *This, SCRIPTSTATE state) { switch(This->state) { @@ -340,8 +355,10 @@ static void decrease_state(VBScript *This, SCRIPTSTATE state) break; release_script(This->ctx); This->thread_id = 0; - if(state == SCRIPTSTATE_CLOSED) + if(state == SCRIPTSTATE_CLOSED) { release_code_list(This->ctx); + release_named_item_list(This->ctx); + } break; case SCRIPTSTATE_CLOSED: break; @@ -539,6 +556,7 @@ static ULONG WINAPI VBScript_Release(IActiveScript *iface) static HRESULT WINAPI VBScript_SetScriptSite(IActiveScript *iface, IActiveScriptSite *pass) { VBScript *This = impl_from_IActiveScript(iface); + named_item_t *item; LCID lcid; HRESULT hres; @@ -553,6 +571,16 @@ static HRESULT WINAPI VBScript_SetScriptSite(IActiveScript *iface, IActiveScript if(InterlockedCompareExchange(&This->thread_id, GetCurrentThreadId(), 0)) return E_UNEXPECTED; + /* Retrieve new dispatches for persistent named items */ + LIST_FOR_EACH_ENTRY(item, &This->ctx->named_items, named_item_t, entry) + { + if(!item->disp) + { + hres = retrieve_named_item_disp(pass, item); + if(FAILED(hres)) return hres; + } + } + hres = create_script_disp(This->ctx, &This->ctx->script_obj); if(FAILED(hres)) return hres;
1
0
0
0
Gabriel Ivăncescu : vbscript: Retrieve the item's dispatch in a helper function.
by Alexandre Julliard
20 Mar '20
20 Mar '20
Module: wine Branch: master Commit: 4287b1f3012ff8659f48e0204a4608cf675ae8c8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4287b1f3012ff8659f48e020…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Mar 19 19:20:15 2020 +0200 vbscript: Retrieve the item's dispatch in a helper function. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/vbscript.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c index 86902d84ea..52bc4ffd0d 100644 --- a/dlls/vbscript/vbscript.c +++ b/dlls/vbscript/vbscript.c @@ -198,6 +198,27 @@ static void exec_queued_code(script_ctx_t *ctx) } } +static HRESULT retrieve_named_item_disp(IActiveScriptSite *site, named_item_t *item) +{ + IUnknown *unk; + HRESULT hres; + + hres = IActiveScriptSite_GetItemInfo(site, item->name, SCRIPTINFO_IUNKNOWN, &unk, NULL); + if(FAILED(hres)) { + WARN("GetItemInfo failed: %08x\n", hres); + return hres; + } + + hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&item->disp); + IUnknown_Release(unk); + if(FAILED(hres)) { + WARN("object does not implement IDispatch\n"); + return hres; + } + + return S_OK; +} + named_item_t *lookup_named_item(script_ctx_t *ctx, const WCHAR *name, unsigned flags) { named_item_t *item; @@ -209,22 +230,10 @@ named_item_t *lookup_named_item(script_ctx_t *ctx, const WCHAR *name, unsigned f hres = create_script_disp(ctx, &item->script_obj); if(FAILED(hres)) return NULL; } + if(!item->disp && (flags || !(item->flags & SCRIPTITEM_CODEONLY))) { - IUnknown *unk; - - hres = IActiveScriptSite_GetItemInfo(ctx->site, item->name, - SCRIPTINFO_IUNKNOWN, &unk, NULL); - if(FAILED(hres)) { - WARN("GetItemInfo failed: %08x\n", hres); - continue; - } - - hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&item->disp); - IUnknown_Release(unk); - if(FAILED(hres)) { - WARN("object does not implement IDispatch\n"); - continue; - } + hres = retrieve_named_item_disp(ctx->site, item); + if(FAILED(hres)) continue; } return item;
1
0
0
0
Gabriel Ivăncescu : vbscript: Retrieve the vbscode context from the named item directly.
by Alexandre Julliard
20 Mar '20
20 Mar '20
Module: wine Branch: master Commit: 408a912f931b25aa6cb31543b44636a552374869 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=408a912f931b25aa6cb31543…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Thu Mar 19 19:20:14 2020 +0200 vbscript: Retrieve the vbscode context from the named item directly. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vbscript/compile.c | 5 ----- dlls/vbscript/interp.c | 6 +++--- dlls/vbscript/vbscript.h | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index cc78daab1a..164c2d15cf 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -1867,8 +1867,6 @@ void release_vbscode(vbscode_t *code) for(i=0; i < code->bstr_cnt; i++) SysFreeString(code->bstr_pool[i]); - if(code->context) - IDispatch_Release(code->context); if(code->named_item) release_named_item(code->named_item); heap_pool_free(&code->heap); @@ -2016,9 +2014,6 @@ HRESULT compile_script(script_ctx_t *script, const WCHAR *src, const WCHAR *item ctx.code = NULL; release_compiler(&ctx); - if(item && item->disp) - IDispatch_AddRef(code->context = item->disp); - list_add_tail(&script->code_list, &code->entry); *ret = code; return S_OK; diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index d2e1d2a63f..95614b1063 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -181,11 +181,11 @@ static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, vbdisp_invoke_type_ } } - if(ctx->func->code_ctx->context) { - hres = disp_get_id(ctx->func->code_ctx->context, name, invoke_type, TRUE, &id); + if(ctx->func->code_ctx->named_item && ctx->func->code_ctx->named_item->disp) { + hres = disp_get_id(ctx->func->code_ctx->named_item->disp, name, invoke_type, TRUE, &id); if(SUCCEEDED(hres)) { ref->type = REF_DISP; - ref->u.d.disp = ctx->func->code_ctx->context; + ref->u.d.disp = ctx->func->code_ctx->named_item->disp; ref->u.d.id = id; return S_OK; } diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index 27ddae3979..aa75b1c0dd 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -348,7 +348,6 @@ struct _vbscode_t { BOOL pending_exec; BOOL is_persistent; function_t main_code; - IDispatch *context; named_item_t *named_item; BSTR *bstr_pool;
1
0
0
0
Zebediah Figura : d3dcompiler: Ensure that the lhs of an assignment is reducible to a variable.
by Alexandre Julliard
19 Mar '20
19 Mar '20
Module: wine Branch: master Commit: aaa625217b202dc0a22d67e63e941b027146a456 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aaa625217b202dc0a22d67e6…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 15 16:25:13 2020 -0500 d3dcompiler: Ensure that the lhs of an assignment is reducible to a variable. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/utils.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 921ef7c2c7..6e9bb593e0 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1456,6 +1456,29 @@ static unsigned int invert_swizzle(unsigned int *swizzle, unsigned int writemask return new_writemask; } +static BOOL validate_lhs_deref(const struct hlsl_ir_node *lhs) +{ + struct hlsl_ir_deref *deref; + + if (lhs->type != HLSL_IR_DEREF) + { + hlsl_report_message(lhs->loc, HLSL_LEVEL_ERROR, "invalid lvalue"); + return FALSE; + } + + deref = deref_from_node(lhs); + + if (deref->src.type == HLSL_IR_DEREF_VAR) + return TRUE; + if (deref->src.type == HLSL_IR_DEREF_ARRAY) + return validate_lhs_deref(deref->src.v.array.array); + if (deref->src.type == HLSL_IR_DEREF_RECORD) + return validate_lhs_deref(deref->src.v.record.record); + + assert(0); + return FALSE; +} + struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *lhs, enum parse_assign_op assign_op, struct hlsl_ir_node *rhs) { @@ -1509,6 +1532,12 @@ struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *lhs, enum parse_assign lhs = lhs_inner; } + if (!validate_lhs_deref(lhs)) + { + d3dcompiler_free(assign); + return NULL; + } + TRACE("Creating proper assignment expression.\n"); if (writemask == BWRITERSP_WRITEMASK_ALL) type = lhs->data_type;
1
0
0
0
Zebediah Figura : d3dcompiler/tests: Add more tests for swizzles.
by Alexandre Julliard
19 Mar '20
19 Mar '20
Module: wine Branch: master Commit: 18b8393ff9a409656de52ef24d0717bab0e44712 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=18b8393ff9a409656de52ef2…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 15 16:25:12 2020 -0500 d3dcompiler/tests: Add more tests for swizzles. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 167 +++++++++++++++++++++------------- 1 file changed, 106 insertions(+), 61 deletions(-) diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c index 3edee34d8d..b96ab16679 100644 --- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c +++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c @@ -294,78 +294,123 @@ static void test_swizzle(void) ID3DXConstantTable *constants; ID3D10Blob *ps_code = NULL; IDirect3DDevice9 *device; + unsigned int i; struct vec4 v; HRESULT hr; - static const char ps_source[] = - "uniform float4 color;\n" - "float4 main() : COLOR\n" - "{\n" - " float4 ret = color;\n" - " ret.gb = ret.ra;\n" - " ret.ra = float2(0.0101, 0.0404);\n" - " return ret;\n" - "}"; - - static const char ps_multiple_lhs_source[] = - "float4 main() : COLOR\n" - "{\n" - " float4 ret = float4(0.1, 0.2, 0.3, 0.4);\n" - " ret.wyz.yx = float2(0.5, 0.6).yx;\n" - " return ret;\n" - "}"; - - static const char ps_multiple_rhs_source[] = - "float4 main() : COLOR\n" - "{\n" - " float4 ret = float4(0.1, 0.2, 0.3, 0.4).ywxz.zyyz;\n" - " return ret;\n" - "}"; - - if (!init_test_context(&test_context)) - return; - device = test_context.device; - - todo_wine ps_code = compile_shader(ps_source, "ps_2_0"); - if (ps_code) + static const struct { - hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants); - ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr); - hr = ID3DXConstantTable_SetVector(constants, device, "color", &color); - ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr); - ID3DXConstantTable_Release(constants); - - draw_quad(device, ps_code); - - v = get_color_vec4(device, 0, 0); - ok(compare_vec4(&v, 0.0101f, 0.0303f, 0.0202f, 0.0404f, 0), - "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w); - - ID3D10Blob_Release(ps_code); + const char *source; + struct vec4 color; } - - todo_wine ps_code = compile_shader(ps_multiple_lhs_source, "ps_2_0"); - if (ps_code) + tests[] = { - draw_quad(device, ps_code); - - v = get_color_vec4(device, 0, 0); - ok(compare_vec4(&v, 0.1f, 0.6f, 0.3f, 0.5f, 0), - "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w); + { + "uniform float4 color;\n" + "float4 main() : COLOR\n" + "{\n" + " float4 ret = color;\n" + " ret.gb = ret.ra;\n" + " ret.ra = float2(0.0101, 0.0404);\n" + " return ret;\n" + "}", + {0.0101f, 0.0303f, 0.0202f, 0.0404f} + }, + { + "float4 main() : COLOR\n" + "{\n" + " float4 ret = float4(0.1, 0.2, 0.3, 0.4);\n" + " ret.wyz.yx = float2(0.5, 0.6).yx;\n" + " return ret;\n" + "}", + {0.1f, 0.6f, 0.3f, 0.5f} + }, + { + "float4 main() : COLOR\n" + "{\n" + " float4 ret;\n" + " ret.zwyx = float4(0.1, 0.2, 0.3, 0.4);\n" + " return ret;\n" + "}", + {0.4f, 0.3f, 0.1f, 0.2f} + }, + { + "float4 main() : COLOR\n" + "{\n" + " float4 ret;\n" + " ret.yw.y = 0.1;\n" + " ret.xzy.yz.y.x = 0.2;\n" + " ret.yzwx.yzwx.wz.y = 0.3;\n" + " ret.zxy.xyz.zxy.xy.y = 0.4;\n" + " return ret;\n" + "}", + {0.3f, 0.2f, 0.4f, 0.1f} + }, + { + "float4 main() : COLOR\n" + "{\n" + " float4 ret;\n" + " ret.yxz.yx = float2(0.1, 0.2);\n" + " ret.w.x = 0.3;\n" + " ret.wzyx.zyx.yx.x = 0.4;\n" + " return ret;\n" + "}", + {0.1f, 0.2f, 0.4f, 0.3f} + }, + { + "float4 main() : COLOR\n" + "{\n" + " float4 ret = float4(0.1, 0.2, 0.3, 0.4).ywxz.zyyz;\n" + " return ret;\n" + "}", + {0.1f, 0.4f, 0.4f, 0.1f} + }, + { + "float4 main() : COLOR\n" + "{\n" + " float4 ret = float4(0.1, 0.2, 0.3, 0.4);\n" + " ret.yxwz = ret;\n" + " ret = ret.wyzx;\n" + " return ret;\n" + "}", + {0.3f, 0.1f, 0.4f, 0.2f} + }, + { + "float4 main() : COLOR\n" + "{\n" + " float4 ret;\n" + " ret.xyzw.xyzw = float4(0.1, 0.2, 0.3, 0.4);\n" + " return ret;\n" + "}", + {0.1f, 0.2f, 0.3f, 0.4f} + }, + }; - ID3D10Blob_Release(ps_code); - } + if (!init_test_context(&test_context)) + return; + device = test_context.device; - todo_wine ps_code = compile_shader(ps_multiple_rhs_source, "ps_2_0"); - if (ps_code) + for (i = 0; i < ARRAY_SIZE(tests); ++i) { - draw_quad(device, ps_code); + todo_wine ps_code = compile_shader(tests[i].source, "ps_2_0"); + if (ps_code) + { + if (i == 0) + { + hr = pD3DXGetShaderConstantTable(ID3D10Blob_GetBufferPointer(ps_code), &constants); + ok(hr == D3D_OK, "Failed to get constant table, hr %#x.\n", hr); + hr = ID3DXConstantTable_SetVector(constants, device, "color", &color); + ok(hr == D3D_OK, "Failed to set constant, hr %#x.\n", hr); + ID3DXConstantTable_Release(constants); + } + draw_quad(device, ps_code); - v = get_color_vec4(device, 0, 0); - ok(compare_vec4(&v, 0.1f, 0.4f, 0.4f, 0.1f, 0), - "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", v.x, v.y, v.z, v.w); + v = get_color_vec4(device, 0, 0); + ok(compare_vec4(&v, tests[i].color.x, tests[i].color.y, tests[i].color.z, tests[i].color.w, 0), + "Test %u: Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n", i, v.x, v.y, v.z, v.w); - ID3D10Blob_Release(ps_code); + ID3D10Blob_Release(ps_code); + } } release_test_context(&test_context);
1
0
0
0
Zebediah Figura : d3dcompiler: Rename HLSL_MODIFIERS_COMPARISON_MASK to HLSL_MODIFIERS_MAJORITY_MASK and use it in more places.
by Alexandre Julliard
19 Mar '20
19 Mar '20
Module: wine Branch: master Commit: 8ea8eb20a4d2a81375a6ffd4d643e89c5444af40 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8ea8eb20a4d2a81375a6ffd4…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 15 16:25:11 2020 -0500 d3dcompiler: Rename HLSL_MODIFIERS_COMPARISON_MASK to HLSL_MODIFIERS_MAJORITY_MASK and use it in more places. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/d3dcompiler_private.h | 2 +- dlls/d3dcompiler_43/hlsl.y | 5 ++--- dlls/d3dcompiler_43/utils.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 957fc24e20..1a9d68e720 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -741,7 +741,7 @@ struct hlsl_ir_node HLSL_MODIFIER_CONST | HLSL_MODIFIER_ROW_MAJOR | \ HLSL_MODIFIER_COLUMN_MAJOR) -#define HLSL_MODIFIERS_COMPARISON_MASK (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR) +#define HLSL_MODIFIERS_MAJORITY_MASK (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR) struct reg_reservation { diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 556c03b11f..4f5a7b1782 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -117,7 +117,7 @@ static void debug_dump_decl(struct hlsl_type *type, DWORD modifiers, const char static void check_invalid_matrix_modifiers(DWORD modifiers, struct source_location loc) { - if (modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)) + if (modifiers & HLSL_MODIFIERS_MAJORITY_MASK) { hlsl_report_message(loc, HLSL_LEVEL_ERROR, "'row_major' or 'column_major' modifiers are only allowed for matrices"); @@ -175,8 +175,7 @@ static DWORD add_modifiers(DWORD modifiers, DWORD mod, const struct source_locat hlsl_report_message(loc, HLSL_LEVEL_ERROR, "modifier '%s' already specified", debug_modifiers(mod)); return modifiers; } - if (mod & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR) - && modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)) + if ((mod & HLSL_MODIFIERS_MAJORITY_MASK) && (modifiers & HLSL_MODIFIERS_MAJORITY_MASK)) { hlsl_report_message(loc, HLSL_LEVEL_ERROR, "more than one matrix majority keyword"); return modifiers; diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 3e8e229c8c..921ef7c2c7 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -892,8 +892,8 @@ BOOL compare_hlsl_types(const struct hlsl_type *t1, const struct hlsl_type *t2) return FALSE; if (t1->base_type == HLSL_TYPE_SAMPLER && t1->sampler_dim != t2->sampler_dim) return FALSE; - if ((t1->modifiers & HLSL_MODIFIERS_COMPARISON_MASK) - != (t2->modifiers & HLSL_MODIFIERS_COMPARISON_MASK)) + if ((t1->modifiers & HLSL_MODIFIERS_MAJORITY_MASK) + != (t2->modifiers & HLSL_MODIFIERS_MAJORITY_MASK)) return FALSE; if (t1->dimx != t2->dimx) return FALSE;
1
0
0
0
Zebediah Figura : d3dcompiler: Move modifer processing up out of the struct_spec rules.
by Alexandre Julliard
19 Mar '20
19 Mar '20
Module: wine Branch: master Commit: f9ce3c7c7aa9802bbbbdb108715770b066a8562a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f9ce3c7c7aa9802bbbbdb108…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 15 16:25:10 2020 -0500 d3dcompiler: Move modifer processing up out of the struct_spec rules. So that storage classes will be stored in the relevant hlsl_ir_var instead of in the type. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/hlsl.y | 62 ++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index fca4ebc529..556c03b11f 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -771,7 +771,7 @@ static struct list *gen_struct_fields(struct hlsl_type *type, DWORD modifiers, s return list; } -static struct hlsl_type *new_struct_type(const char *name, DWORD modifiers, struct list *fields) +static struct hlsl_type *new_struct_type(const char *name, struct list *fields) { struct hlsl_type *type = d3dcompiler_alloc(sizeof(*type)); @@ -783,7 +783,6 @@ static struct hlsl_type *new_struct_type(const char *name, DWORD modifiers, stru type->type = HLSL_CLASS_STRUCT; type->name = name; type->dimx = type->dimy = 1; - type->modifiers = modifiers; type->e.elements = fields; list_add_tail(&hlsl_ctx.types, &type->entry); @@ -1127,6 +1126,8 @@ static unsigned int evaluate_array_dimension(struct hlsl_ir_node *node) %type <type> struct_spec %type <type> named_struct_spec %type <type> unnamed_struct_spec +%type <type> field_type +%type <type> typedef_type %type <list> type_specs %type <variable_def> type_spec %type <initializer> complex_initializer @@ -1248,56 +1249,60 @@ preproc_directive: PRE_LINE STRING } } -struct_declaration: struct_spec variables_def_optional ';' +struct_declaration: var_modifiers struct_spec variables_def_optional ';' { - if (!$2) + struct hlsl_type *type; + DWORD modifiers = $1; + + if (!$3) { - if (!$1->name) + if (!$2->name) { hlsl_report_message(get_location(&@1), HLSL_LEVEL_ERROR, "anonymous struct declaration with no variables"); } - if ($1->modifiers) + if (modifiers) { hlsl_report_message(get_location(&@1), HLSL_LEVEL_ERROR, "modifier not allowed on struct type declaration"); } } - $$ = declare_vars($1, 0, $2); + + if (!(type = apply_type_modifiers($2, &modifiers, get_location(&@1)))) + YYABORT; + $$ = declare_vars(type, modifiers, $3); } struct_spec: named_struct_spec | unnamed_struct_spec -named_struct_spec: var_modifiers KW_STRUCT any_identifier '{' fields_list '}' +named_struct_spec: KW_STRUCT any_identifier '{' fields_list '}' { BOOL ret; - TRACE("Structure %s declaration.\n", debugstr_a($3)); - check_invalid_matrix_modifiers($1, get_location(&@1)); - $$ = new_struct_type($3, $1, $5); + TRACE("Structure %s declaration.\n", debugstr_a($2)); + $$ = new_struct_type($2, $4); - if (get_variable(hlsl_ctx.cur_scope, $3)) + if (get_variable(hlsl_ctx.cur_scope, $2)) { - hlsl_report_message(get_location(&@3), - HLSL_LEVEL_ERROR, "redefinition of '%s'", $3); + hlsl_report_message(get_location(&@2), + HLSL_LEVEL_ERROR, "redefinition of '%s'", $2); YYABORT; } ret = add_type_to_scope(hlsl_ctx.cur_scope, $$); if (!ret) { - hlsl_report_message(get_location(&@3), - HLSL_LEVEL_ERROR, "redefinition of struct '%s'", $3); + hlsl_report_message(get_location(&@2), + HLSL_LEVEL_ERROR, "redefinition of struct '%s'", $2); YYABORT; } } -unnamed_struct_spec: var_modifiers KW_STRUCT '{' fields_list '}' +unnamed_struct_spec: KW_STRUCT '{' fields_list '}' { TRACE("Anonymous structure declaration.\n"); - check_invalid_matrix_modifiers($1, get_location(&@1)); - $$ = new_struct_type(NULL, $1, $4); + $$ = new_struct_type(NULL, $3); } any_identifier: VAR_IDENTIFIER @@ -1328,7 +1333,10 @@ fields_list: /* Empty */ d3dcompiler_free($2); } -field: var_modifiers type variables_def ';' +field_type: type + | unnamed_struct_spec + +field: var_modifiers field_type variables_def ';' { struct hlsl_type *type; DWORD modifiers = $1; @@ -1337,10 +1345,6 @@ field: var_modifiers type variables_def ';' YYABORT; $$ = gen_struct_fields(type, modifiers, $3); } - | unnamed_struct_spec variables_def ';' - { - $$ = gen_struct_fields($1, 0, $2); - } func_declaration: func_prototype compound_statement { @@ -1636,7 +1640,10 @@ declaration_statement: declaration list_init($$); } -typedef: KW_TYPEDEF var_modifiers type type_specs ';' +typedef_type: type + | struct_spec + +typedef: KW_TYPEDEF var_modifiers typedef_type type_specs ';' { if ($2 & ~HLSL_TYPE_MODIFIERS_MASK) { @@ -1651,11 +1658,6 @@ typedef: KW_TYPEDEF var_modifiers type type_specs ';' if (!add_typedef($2, $3, $4)) YYABORT; } - | KW_TYPEDEF struct_spec type_specs ';' - { - if (!add_typedef(0, $2, $3)) - YYABORT; - } type_specs: type_spec {
1
0
0
0
Zebediah Figura : d3dcompiler: Rename HLSL_MODIFIER_{IN, OUT} to HLSL_STORAGE_{IN, OUT}.
by Alexandre Julliard
19 Mar '20
19 Mar '20
Module: wine Branch: master Commit: a82ec54862fb092df32acd1d9690af4784c31624 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a82ec54862fb092df32acd1d…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sun Mar 15 16:25:09 2020 -0500 d3dcompiler: Rename HLSL_MODIFIER_{IN, OUT} to HLSL_STORAGE_{IN, OUT}. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/d3dcompiler_private.h | 4 ++-- dlls/d3dcompiler_43/hlsl.y | 8 ++++---- dlls/d3dcompiler_43/utils.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 830434c9ff..957fc24e20 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -734,8 +734,8 @@ struct hlsl_ir_node #define HLSL_MODIFIER_CONST 0x00000100 #define HLSL_MODIFIER_ROW_MAJOR 0x00000200 #define HLSL_MODIFIER_COLUMN_MAJOR 0x00000400 -#define HLSL_MODIFIER_IN 0x00000800 -#define HLSL_MODIFIER_OUT 0x00001000 +#define HLSL_STORAGE_IN 0x00000800 +#define HLSL_STORAGE_OUT 0x00001000 #define HLSL_TYPE_MODIFIERS_MASK (HLSL_MODIFIER_PRECISE | HLSL_STORAGE_VOLATILE | \ HLSL_MODIFIER_CONST | HLSL_MODIFIER_ROW_MAJOR | \ diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 6a5dddf5d4..fca4ebc529 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1489,7 +1489,7 @@ parameter: input_mods var_modifiers type any_identifier colon_att if (!(type = apply_type_modifiers($3, &modifiers, get_location(&@2)))) YYABORT; - $$.modifiers = $1 ? $1 : HLSL_MODIFIER_IN; + $$.modifiers = $1 ? $1 : HLSL_STORAGE_IN; $$.modifiers |= modifiers; $$.type = type; $$.name = $4; @@ -1514,15 +1514,15 @@ input_mods: /* Empty */ input_mod: KW_IN { - $$ = HLSL_MODIFIER_IN; + $$ = HLSL_STORAGE_IN; } | KW_OUT { - $$ = HLSL_MODIFIER_OUT; + $$ = HLSL_STORAGE_OUT; } | KW_INOUT { - $$ = HLSL_MODIFIER_IN | HLSL_MODIFIER_OUT; + $$ = HLSL_STORAGE_IN | HLSL_STORAGE_OUT; } type: base_type diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 29b35c3d7e..3e8e229c8c 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1808,11 +1808,11 @@ const char *debug_modifiers(DWORD modifiers) strcat(string, " row_major"); /* 10 */ if (modifiers & HLSL_MODIFIER_COLUMN_MAJOR) strcat(string, " column_major"); /* 13 */ - if ((modifiers & (HLSL_MODIFIER_IN | HLSL_MODIFIER_OUT)) == (HLSL_MODIFIER_IN | HLSL_MODIFIER_OUT)) + if ((modifiers & (HLSL_STORAGE_IN | HLSL_STORAGE_OUT)) == (HLSL_STORAGE_IN | HLSL_STORAGE_OUT)) strcat(string, " inout"); /* 6 */ - else if (modifiers & HLSL_MODIFIER_IN) + else if (modifiers & HLSL_STORAGE_IN) strcat(string, " in"); /* 3 */ - else if (modifiers & HLSL_MODIFIER_OUT) + else if (modifiers & HLSL_STORAGE_OUT) strcat(string, " out"); /* 4 */ return wine_dbg_sprintf("%s", string[0] ? string + 1 : "");
1
0
0
0
Rémi Bernon : user32/tests: Add new test to validate WM_CANCELMODE message.
by Alexandre Julliard
19 Mar '20
19 Mar '20
Module: wine Branch: master Commit: cf2148e17c354e701285f48feee10225504da2d5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cf2148e17c354e701285f48f…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Mar 4 15:53:22 2020 +0100 user32/tests: Add new test to validate WM_CANCELMODE message. The ShowWindow(SW_SHOWMINIMIZED):overlapped test shows that the message should not be sent in general. This additional test shows that we should still send the message if a menu is active. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 07f21607e8..93ab7b4a27 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -1923,6 +1923,41 @@ static const struct message WmSHOWNATopInvisible[] = { { 0 } }; +static const struct message WmTrackPopupMenuMinimizeWindow[] = { + { HCBT_CREATEWND, hook }, + { WM_ENTERMENULOOP, sent|wparam|lparam, TRUE, 0 }, + { WM_INITMENU, sent|lparam, 0, 0 }, + { WM_INITMENUPOPUP, sent|lparam, 0, 0 }, + { 0x0093, sent|optional }, + { 0x0094, sent|optional }, + { 0x0094, sent|optional }, + { WM_ENTERIDLE, sent|wparam, 2 }, + { HCBT_MINMAX, hook }, + { HCBT_SETFOCUS, hook }, + { WM_KILLFOCUS, sent|wparam, 0 }, + { WM_GETTEXT, sent|optional }, + { WM_WINDOWPOSCHANGING, sent }, + { WM_GETMINMAXINFO, sent|defwinproc }, + { WM_NCCALCSIZE, sent|wparam|optional, 1 }, + { WM_WINDOWPOSCHANGED, sent }, + { WM_MOVE, sent|defwinproc }, + { WM_SIZE, sent|defwinproc }, + { WM_GETTEXT, sent|optional }, + { WM_NCCALCSIZE, sent|wparam|optional, 1 }, + { WM_CANCELMODE, sent }, + { WM_CAPTURECHANGED, sent|defwinproc }, + { HCBT_DESTROYWND, hook }, + { WM_UNINITMENUPOPUP, sent|defwinproc|lparam, 0, 0 }, + { WM_MENUSELECT, sent|defwinproc|wparam|lparam, 0xffff0000, 0 }, + { WM_EXITMENULOOP, sent|defwinproc|wparam|lparam, 1, 0 }, + { WM_NCACTIVATE, sent }, + { WM_GETTEXT, sent|defwinproc|optional }, + { WM_GETTEXT, sent|defwinproc|optional }, + { WM_ACTIVATE, sent }, + { WM_ACTIVATEAPP, sent|wparam, 0 }, + { 0 } +}; + static const struct message WmTrackPopupMenu[] = { { HCBT_CREATEWND, hook }, { WM_ENTERMENULOOP, sent|wparam|lparam, TRUE, 0 }, @@ -17308,6 +17343,25 @@ static void test_layered_window(void) static HMENU hpopupmenu; +static LRESULT WINAPI minimize_popup_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + LRESULT ret; + + if (ignore_message( message )) return 0; + ret = MsgCheckProc( FALSE, hwnd, message, wParam, lParam ); + + switch (message) { + case WM_ENTERIDLE: + ShowWindow(hwnd, SW_MINIMIZE); + break; + case WM_TIMER: + EndMenu(); + break; + } + + return ret; +} + static LRESULT WINAPI cancel_popup_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { if (ignore_message( message )) return 0; @@ -17390,6 +17444,21 @@ static void test_TrackPopupMenu(void) ok_sequence(WmTrackPopupMenuAbort, "WmTrackPopupMenuAbort", TRUE); ok(ret == TRUE, "TrackPopupMenu failed\n"); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)minimize_popup_proc); + + /* set cursor over the window, otherwise the WM_CANCELMODE message may not always be sent */ + SetCursorPos( 0, 0 ); + ShowWindow( hwnd, SW_SHOW ); + + flush_events(); + flush_sequence(); + SetTimer( hwnd, TIMER_ID, 500, NULL ); + ret = TrackPopupMenu( hpopupmenu, 0, 100,100, 0, hwnd, NULL ); + ok_sequence( WmTrackPopupMenuMinimizeWindow, "TrackPopupMenuMinimizeWindow", TRUE ); + ok( ret == 1, "TrackPopupMenu failed with error %i\n", GetLastError() ); + KillTimer( hwnd, TIMER_ID ); + ShowWindow( hwnd, SW_RESTORE ); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)cancel_popup_proc); SetCapture(hwnd);
1
0
0
0
← Newer
1
...
40
41
42
43
44
45
46
...
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