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
January 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
535 discussions
Start a n
N
ew thread
Nikolay Sivov : ole32: Fix a leak when creating antimoniker through activation.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: 82044449c45d4037dae393bc348579e87d9c4b10 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=82044449c45d4037dae393bc…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 30 14:53:46 2020 +0300 ole32: Fix a leak when creating antimoniker through activation. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/antimoniker.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/ole32/antimoniker.c b/dlls/ole32/antimoniker.c index 6efd4ae853..7abbfc544f 100644 --- a/dlls/ole32/antimoniker.c +++ b/dlls/ole32/antimoniker.c @@ -668,9 +668,7 @@ HRESULT WINAPI AntiMoniker_CreateInstance(IClassFactory *iface, return hr; hr = IMoniker_QueryInterface(pMoniker, riid, ppv); - - if (FAILED(hr)) - IMoniker_Release(pMoniker); + IMoniker_Release(pMoniker); return hr; }
1
0
0
0
Nikolay Sivov : ole32: Fix a leak when creating pointer moniker through activation.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: 157651a7846c227638ce9121d99ddf0af4722f41 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=157651a7846c227638ce9121…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 30 14:53:45 2020 +0300 ole32: Fix a leak when creating pointer moniker through activation. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/pointermoniker.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/ole32/pointermoniker.c b/dlls/ole32/pointermoniker.c index b2f6c2af95..2ece11f53b 100644 --- a/dlls/ole32/pointermoniker.c +++ b/dlls/ole32/pointermoniker.c @@ -699,9 +699,7 @@ HRESULT WINAPI PointerMoniker_CreateInstance(IClassFactory *iface, return hr; hr = IMoniker_QueryInterface(pMoniker, riid, ppv); - - if (FAILED(hr)) - IMoniker_Release(pMoniker); + IMoniker_Release(pMoniker); return hr; }
1
0
0
0
Nikolay Sivov : ole32: Get rid of pointer moniker initialization helper.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: bea01f4532f7cade40a2fc4482543c040d04a862 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bea01f4532f7cade40a2fc44…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 30 14:53:44 2020 +0300 ole32: Get rid of pointer moniker initialization helper. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/pointermoniker.c | 89 ++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 58 deletions(-) diff --git a/dlls/ole32/pointermoniker.c b/dlls/ole32/pointermoniker.c index 101fda4e3b..b2f6c2af95 100644 --- a/dlls/ole32/pointermoniker.c +++ b/dlls/ole32/pointermoniker.c @@ -32,6 +32,7 @@ #include "objbase.h" #include "oleidl.h" #include "wine/debug.h" +#include "wine/heap.h" #include "moniker.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -42,7 +43,7 @@ typedef struct PointerMonikerImpl IMoniker IMoniker_iface; IMarshal IMarshal_iface; - LONG ref; /* reference counter for this object */ + LONG refcount; IUnknown *pObject; } PointerMonikerImpl; @@ -88,40 +89,30 @@ static HRESULT WINAPI PointerMonikerImpl_QueryInterface(IMoniker *iface, REFIID return S_OK; } -/****************************************************************************** - * PointerMoniker_AddRef - ******************************************************************************/ -static ULONG WINAPI -PointerMonikerImpl_AddRef(IMoniker* iface) +static ULONG WINAPI PointerMonikerImpl_AddRef(IMoniker *iface) { - PointerMonikerImpl *This = impl_from_IMoniker(iface); + PointerMonikerImpl *moniker = impl_from_IMoniker(iface); + ULONG refcount = InterlockedIncrement(&moniker->refcount); - TRACE("(%p)\n",This); + TRACE("%p, refcount %u.\n", iface, refcount); - return InterlockedIncrement(&This->ref); + return refcount; } -/****************************************************************************** - * PointerMoniker_Release - ******************************************************************************/ -static ULONG WINAPI -PointerMonikerImpl_Release(IMoniker* iface) +static ULONG WINAPI PointerMonikerImpl_Release(IMoniker *iface) { - PointerMonikerImpl *This = impl_from_IMoniker(iface); - ULONG ref; - - TRACE("(%p)\n",This); + PointerMonikerImpl *moniker = impl_from_IMoniker(iface); + ULONG refcount = InterlockedDecrement(&moniker->refcount); - ref = InterlockedDecrement(&This->ref); + TRACE("%p, refcount %u.\n", iface, refcount); - /* destroy the object if there are no more references on it */ - if (ref == 0) + if (!refcount) { - if (This->pObject) IUnknown_Release(This->pObject); - HeapFree(GetProcessHeap(),0,This); + if (moniker->pObject) IUnknown_Release(moniker->pObject); + heap_free(moniker); } - return ref; + return refcount; } /****************************************************************************** @@ -659,52 +650,34 @@ static const IMarshalVtbl pointer_moniker_marshal_vtbl = pointer_moniker_marshal_DisconnectObject }; -/****************************************************************************** - * PointerMoniker_Construct (local function) - *******************************************************************************/ -static void PointerMonikerImpl_Construct(PointerMonikerImpl* This, IUnknown *punk) -{ - TRACE("(%p)\n",This); - - This->IMoniker_iface.lpVtbl = &VT_PointerMonikerImpl; - This->IMarshal_iface.lpVtbl = &pointer_moniker_marshal_vtbl; - This->ref = 1; - if (punk) - IUnknown_AddRef(punk); - This->pObject = punk; -} - /*********************************************************************** * CreatePointerMoniker (OLE32.@) - * - * Creates a moniker which represents a pointer. - * - * PARAMS - * punk [I] Pointer to the object to represent. - * ppmk [O] Address that receives the pointer to the created moniker. - * - * RETURNS - * Success: S_OK. - * Failure: Any HRESULT code. */ -HRESULT WINAPI CreatePointerMoniker(LPUNKNOWN punk, LPMONIKER *ppmk) +HRESULT WINAPI CreatePointerMoniker(IUnknown *object, IMoniker **ret) { - PointerMonikerImpl *This; + PointerMonikerImpl *moniker; - TRACE("(%p, %p)\n", punk, ppmk); + TRACE("(%p, %p)\n", object, ret); - if (!ppmk) + if (!ret) return E_INVALIDARG; - This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); - if (!This) + moniker = heap_alloc(sizeof(*moniker)); + if (!moniker) { - *ppmk = NULL; + *ret = NULL; return E_OUTOFMEMORY; } - PointerMonikerImpl_Construct(This, punk); - *ppmk = &This->IMoniker_iface; + moniker->IMoniker_iface.lpVtbl = &VT_PointerMonikerImpl; + moniker->IMarshal_iface.lpVtbl = &pointer_moniker_marshal_vtbl; + moniker->refcount = 1; + moniker->pObject = object; + if (moniker->pObject) + IUnknown_AddRef(moniker->pObject); + + *ret = &moniker->IMoniker_iface; + return S_OK; }
1
0
0
0
Nikolay Sivov : ole32: Enumeration is not supported for pointer monikers.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: 2017977cb30b1ed724491cd87dc043a6c15780ac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2017977cb30b1ed724491cd8…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 30 14:53:43 2020 +0300 ole32: Enumeration is not supported for pointer monikers. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/pointermoniker.c | 9 ++++----- dlls/ole32/tests/moniker.c | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dlls/ole32/pointermoniker.c b/dlls/ole32/pointermoniker.c index bb578a6f61..101fda4e3b 100644 --- a/dlls/ole32/pointermoniker.c +++ b/dlls/ole32/pointermoniker.c @@ -328,17 +328,16 @@ PointerMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight, /****************************************************************************** * PointerMoniker_Enum ******************************************************************************/ -static HRESULT WINAPI -PointerMonikerImpl_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker) +static HRESULT WINAPI PointerMonikerImpl_Enum(IMoniker *iface, BOOL fForward, IEnumMoniker **ppenumMoniker) { - TRACE("(%p,%d,%p)\n",iface,fForward,ppenumMoniker); + TRACE("%p, %d, %p.\n", iface, fForward, ppenumMoniker); - if (ppenumMoniker == NULL) + if (!ppenumMoniker) return E_POINTER; *ppenumMoniker = NULL; - return S_OK; + return E_NOTIMPL; } /****************************************************************************** diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index 4c273547cb..7e7d615645 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -3008,11 +3008,9 @@ todo_wine /* Enum() */ hr = IMoniker_Enum(moniker, TRUE, &enummoniker); -todo_wine ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); hr = IMoniker_Enum(moniker, FALSE, &enummoniker); -todo_wine ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr); IMoniker_Release(moniker);
1
0
0
0
Nikolay Sivov : ole32: Get rid of redundant pointer check.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: 5d5eb585280262a9e27b75a3f80a6eddb2295f4a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5d5eb585280262a9e27b75a3…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 30 14:53:42 2020 +0300 ole32: Get rid of redundant pointer check. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/pointermoniker.c | 20 ++++++++------------ dlls/ole32/tests/moniker.c | 3 +++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/ole32/pointermoniker.c b/dlls/ole32/pointermoniker.c index a16a56a098..bb578a6f61 100644 --- a/dlls/ole32/pointermoniker.c +++ b/dlls/ole32/pointermoniker.c @@ -58,20 +58,18 @@ static PointerMonikerImpl *impl_from_IMarshal(IMarshal *iface) } static PointerMonikerImpl *unsafe_impl_from_IMoniker(IMoniker *iface); -static HRESULT WINAPI -PointerMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) + +static HRESULT WINAPI PointerMonikerImpl_QueryInterface(IMoniker *iface, REFIID riid, void **ppvObject) { - PointerMonikerImpl *This = impl_from_IMoniker(iface); + PointerMonikerImpl *moniker = impl_from_IMoniker(iface); - TRACE("(%p,%s,%p)\n",This,debugstr_guid(riid),ppvObject); + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppvObject); - if ( (This==0) || (ppvObject==0) ) - return E_INVALIDARG; + if (!ppvObject) + return E_INVALIDARG; - /* Initialize the return parameter */ *ppvObject = 0; - /* Compare the riid with the interface IDs implemented by this object.*/ if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IPersist, riid) || IsEqualIID(&IID_IPersistStream, riid) || @@ -80,13 +78,11 @@ PointerMonikerImpl_QueryInterface(IMoniker* iface,REFIID riid,void** ppvObject) *ppvObject = iface; } else if (IsEqualIID(&IID_IMarshal, riid)) - *ppvObject = &This->IMarshal_iface; + *ppvObject = &moniker->IMarshal_iface; - /* Check that we obtained an interface.*/ - if ((*ppvObject)==0) + if (!*ppvObject) return E_NOINTERFACE; - /* always increase the reference count by one when it is successful */ IMoniker_AddRef(iface); return S_OK; diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index 7b2dfcfe08..4c273547cb 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -2886,6 +2886,9 @@ static void test_pointer_moniker(void) hr = CreatePointerMoniker((IUnknown *)&Test_ClassFactory, &moniker); ok_ole_success(hr, CreatePointerMoniker); + hr = IMoniker_QueryInterface(moniker, &IID_IMoniker, NULL); + ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); + hr = IMoniker_QueryInterface(moniker, &CLSID_PointerMoniker, (void **)&unknown); todo_wine ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
1
0
0
0
Nikolay Sivov : ole32: Fix (file moniker + antimoniker) composing.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: 69bb0c7765e8223f0f4b11c92c92f7d0c877317d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=69bb0c7765e8223f0f4b11c9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 30 14:53:41 2020 +0300 ole32: Fix (file moniker + antimoniker) composing. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/filemoniker.c | 9 ++++----- dlls/ole32/tests/moniker.c | 6 +----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dlls/ole32/filemoniker.c b/dlls/ole32/filemoniker.c index 1e945f9a5f..6310a5acd5 100644 --- a/dlls/ole32/filemoniker.c +++ b/dlls/ole32/filemoniker.c @@ -666,7 +666,7 @@ FileMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight, static const WCHAR bkSlash[]={'\\',0}; IBindCtx *bind=0; int i=0,j=0,lastIdx1=0,lastIdx2=0; - DWORD mkSys; + DWORD mkSys, order; TRACE("(%p,%p,%d,%p)\n",iface,pmkRight,fOnlyIfNotGeneric,ppmkComposite); @@ -735,10 +735,9 @@ FileMonikerImpl_ComposeWith(IMoniker* iface, IMoniker* pmkRight, return res; } - else if(mkSys==MKSYS_ANTIMONIKER){ - - *ppmkComposite=NULL; - return S_OK; + else if (is_anti_moniker(pmkRight, &order)) + { + return order > 1 ? create_anti_moniker(order - 1, ppmkComposite) : S_OK; } else if (fOnlyIfNotGeneric){ diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c index ea1e5b1933..7b2dfcfe08 100644 --- a/dlls/ole32/tests/moniker.c +++ b/dlls/ole32/tests/moniker.c @@ -1958,16 +1958,12 @@ todo_wine anti = create_antimoniker(2); hr = IMoniker_ComposeWith(moniker1, anti, TRUE, &moniker2); ok(hr == S_OK, "Failed to compose, hr %#x.\n", hr); -todo_wine - ok(!!moniker2, "Unexpected pointer.\n"); -if (moniker2) -{ TEST_MONIKER_TYPE(moniker2, MKSYS_ANTIMONIKER); hr = IMoniker_Hash(moniker2, &hash); ok(hr == S_OK, "Failed to get hash, hr %#x.\n", hr); ok(hash == 0x80000001, "Unexpected hash.\n"); IMoniker_Release(moniker2); -} + IMoniker_Release(anti); IMoniker_Release(moniker1);
1
0
0
0
Jacek Caban : jscript: Add IActiveScriptError implementation.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: 75482382979193af5321816f1e03a9f785cafca9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=75482382979193af5321816f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jan 30 15:50:47 2020 +0100 jscript: Add IActiveScriptError implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/jscript.c | 133 +++++++++++++++++++++++++++++++++++++++++++++-- dlls/jscript/tests/run.c | 13 +++-- 2 files changed, 139 insertions(+), 7 deletions(-) diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 1564e859b8..81bf7e440d 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -64,6 +64,12 @@ typedef struct { struct list queued_code; } JScript; +typedef struct { + IActiveScriptError IActiveScriptError_iface; + LONG ref; + jsexcept_t ei; +} JScriptError; + void script_release(script_ctx_t *ctx) { if(--ctx->ref) @@ -101,6 +107,106 @@ static inline BOOL is_started(script_ctx_t *ctx) || ctx->state == SCRIPTSTATE_DISCONNECTED; } +static inline JScriptError *impl_from_IActiveScriptError(IActiveScriptError *iface) +{ + return CONTAINING_RECORD(iface, JScriptError, IActiveScriptError_iface); +} + +static HRESULT WINAPI JScriptError_QueryInterface(IActiveScriptError *iface, REFIID riid, void **ppv) +{ + JScriptError *This = impl_from_IActiveScriptError(iface); + + if(IsEqualGUID(riid, &IID_IUnknown)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = &This->IActiveScriptError_iface; + }else if(IsEqualGUID(riid, &IID_IActiveScriptError)) { + TRACE("(%p)->(IID_IActiveScriptError %p)\n", This, ppv); + *ppv = &This->IActiveScriptError_iface; + }else { + FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI JScriptError_AddRef(IActiveScriptError *iface) +{ + JScriptError *This = impl_from_IActiveScriptError(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI JScriptError_Release(IActiveScriptError *iface) +{ + JScriptError *This = impl_from_IActiveScriptError(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + reset_ei(&This->ei); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI JScriptError_GetExceptionInfo(IActiveScriptError *iface, EXCEPINFO *excepinfo) +{ + JScriptError *This = impl_from_IActiveScriptError(iface); + + TRACE("(%p)->(%p)\n", This, excepinfo); + + if(!excepinfo) + return E_POINTER; + + memset(excepinfo, 0, sizeof(*excepinfo)); + excepinfo->scode = This->ei.error; + return S_OK; +} + +static HRESULT WINAPI JScriptError_GetSourcePosition(IActiveScriptError *iface, DWORD *source_context, ULONG *line, LONG *character) +{ + JScriptError *This = impl_from_IActiveScriptError(iface); + + FIXME("(%p)->(%p %p %p)\n", This, source_context, line, character); + + if(source_context) + *source_context = 0; + if(line) + *line = 0; + if(character) + *character = 0; + return S_OK; +} + +static HRESULT WINAPI JScriptError_GetSourceLineText(IActiveScriptError *iface, BSTR *source) +{ + JScriptError *This = impl_from_IActiveScriptError(iface); + + FIXME("(%p)->(%p)\n", This, source); + + if(!source) + return E_POINTER; + *source = NULL; + return E_FAIL; +} + +static const IActiveScriptErrorVtbl JScriptErrorVtbl = { + JScriptError_QueryInterface, + JScriptError_AddRef, + JScriptError_Release, + JScriptError_GetExceptionInfo, + JScriptError_GetSourcePosition, + JScriptError_GetSourceLineText +}; + void reset_ei(jsexcept_t *ei) { ei->error = S_OK; @@ -121,14 +227,33 @@ void enter_script(script_ctx_t *ctx, jsexcept_t *ei) HRESULT leave_script(script_ctx_t *ctx, HRESULT result) { jsexcept_t *ei = ctx->ei; + JScriptError *error; TRACE("ctx %p ei %p prev %p\n", ctx, ei, ei->prev); ctx->ei = ei->prev; - if(result == DISP_E_EXCEPTION) + if(result == DISP_E_EXCEPTION) { result = ei->error; - if(FAILED(result)) + }else { + reset_ei(ei); + ei->error = result; + } + if(FAILED(result)) { WARN("%08x\n", result); + if(ctx->site && (error = heap_alloc(sizeof(*error)))) { + HRESULT hres; + + error->IActiveScriptError_iface.lpVtbl = &JScriptErrorVtbl; + error->ref = 1; + error->ei = *ei; + memset(ei, 0, sizeof(*ei)); + + hres = IActiveScriptSite_OnScriptError(ctx->site, &error->IActiveScriptError_iface); + IActiveScriptError_Release(&error->IActiveScriptError_iface); + if(hres == S_OK) + result = SCRIPT_E_REPORTED; + } + } if(ei->enter_notified && ctx->site) IActiveScriptSite_OnLeaveScript(ctx->site); reset_ei(ei); @@ -162,12 +287,14 @@ static void exec_queued_code(JScript *This) { bytecode_t *iter; jsexcept_t ei; - HRESULT hres; + HRESULT hres = S_OK; LIST_FOR_EACH_ENTRY(iter, &This->queued_code, bytecode_t, entry) { enter_script(This->ctx, &ei); hres = exec_source(This->ctx, EXEC_GLOBAL, iter, &iter->global_code, NULL, NULL, NULL, This->ctx->global, 0, NULL, NULL); leave_script(This->ctx, hres); + if(FAILED(hres)) + break; } clear_script_queue(This); diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index ddac4fb904..8b3cc8a1d2 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -2265,9 +2265,10 @@ static void test_error_reports(void) script_error = NULL; SET_EXPECT(ActiveScriptSite_OnScriptError); hres = IActiveScriptParse_ParseScriptText(parser, tests[i].script, NULL, NULL, NULL, 10, 0, 0, NULL, NULL); - todo_wine - ok(hres == SCRIPT_E_REPORTED || (tests[i].error == JS_E_EXCEPTION_THROWN && hres == SCRIPT_E_PROPAGATE), "[%u] got: 0x%08x\n", i, hres); - todo_wine + todo_wine_if(tests[i].todo_flags & ERROR_TODO_PARSE) + ok(hres == SCRIPT_E_REPORTED || (tests[i].error == JS_E_EXCEPTION_THROWN && hres == SCRIPT_E_PROPAGATE), + "[%u] got: 0x%08x for %s\n", i, hres, wine_dbgstr_w(tests[i].script)); + todo_wine_if(tests[i].todo_flags & ERROR_TODO_PARSE) CHECK_CALLED(ActiveScriptSite_OnScriptError); if (script_error) @@ -2284,16 +2285,19 @@ static void test_error_reports(void) source_context = 0xdeadbeef; hres = IActiveScriptError_GetSourcePosition(script_error, &source_context, NULL, NULL); ok(hres == S_OK, "GetSourcePosition failed0x%08x\n", hres); + todo_wine ok(source_context == 10, "source_context = %x\n", source_context); line_number = 0xdeadbeef; hres = IActiveScriptError_GetSourcePosition(script_error, NULL, &line_number, NULL); ok(hres == S_OK, "GetSourcePosition failed%08x\n", hres); + todo_wine_if(tests[i].line) ok(line_number == tests[i].line, "[%u] line = %u expected %u\n", i, line_number, tests[i].line); character = 0xdeadbeef; hres = IActiveScriptError_GetSourcePosition(script_error, NULL, NULL, &character); ok(hres == S_OK, "GetSourcePosition failed: %08x\n", hres); + todo_wine_if(tests[i].character) ok(character == tests[i].character, "[%u] character = %u expected %u\n", i, character, tests[i].character); hres = IActiveScriptError_GetSourceLineText(script_error, NULL); @@ -2341,12 +2345,13 @@ static void test_error_reports(void) if (is_lang_english()) { if(tests[i].error_source) + todo_wine ok(ei.bstrSource && !lstrcmpW(ei.bstrSource, tests[i].error_source), "[%u] bstrSource = %s expected %s\n", i, wine_dbgstr_w(ei.bstrSource), wine_dbgstr_w(tests[i].error_source)); else ok(!ei.bstrSource, "[%u] bstrSource = %s expected NULL\n", i, wine_dbgstr_w(ei.bstrSource)); if(tests[i].description) - todo_wine_if(tests[i].todo_flags & ERROR_TODO_DESCRIPTION) + todo_wine ok(ei.bstrDescription && !lstrcmpW(ei.bstrDescription, tests[i].description), "[%u] bstrDescription = %s expected %s\n", i, wine_dbgstr_w(ei.bstrDescription), wine_dbgstr_w(tests[i].description)); else
1
0
0
0
Jacek Caban : jscript: Use enter_script and leave_script to call script site notifications.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: 33984c390df823b1d23890f2ed8b5223b067f7ea URL:
https://source.winehq.org/git/wine.git/?a=commit;h=33984c390df823b1d23890f2…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jan 30 15:50:39 2020 +0100 jscript: Use enter_script and leave_script to call script site notifications. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 5 +++++ dlls/jscript/engine.h | 1 + dlls/jscript/jscript.c | 22 ++++------------------ dlls/jscript/tests/caller.c | 2 -- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 0d9af71715..8b121747fe 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2977,6 +2977,11 @@ HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, functi unsigned i; HRESULT hres; + if(!ctx->ei->enter_notified) { + ctx->ei->enter_notified = TRUE; + IActiveScriptSite_OnEnterScript(ctx->site); + } + for(i = 0; i < function->func_cnt; i++) { jsdisp_t *func_obj; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 5f0035baac..a33611fced 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -227,6 +227,7 @@ struct _jsexcept_t { BOOL valid_value; jsval_t value; + BOOL enter_notified; jsexcept_t *prev; }; diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 28bde3bb33..1564e859b8 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -129,22 +129,12 @@ HRESULT leave_script(script_ctx_t *ctx, HRESULT result) result = ei->error; if(FAILED(result)) WARN("%08x\n", result); + if(ei->enter_notified && ctx->site) + IActiveScriptSite_OnLeaveScript(ctx->site); reset_ei(ei); return result; } -static HRESULT exec_global_code(JScript *This, bytecode_t *code) -{ - HRESULT hres; - - IActiveScriptSite_OnEnterScript(This->site); - - hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, NULL, This->ctx->global, 0, NULL, NULL); - - IActiveScriptSite_OnLeaveScript(This->site); - return hres; -} - static void clear_script_queue(JScript *This) { while(!list_empty(&This->queued_code)) @@ -176,7 +166,7 @@ static void exec_queued_code(JScript *This) LIST_FOR_EACH_ENTRY(iter, &This->queued_code, bytecode_t, entry) { enter_script(This->ctx, &ei); - hres = exec_global_code(This, iter); + hres = exec_source(This->ctx, EXEC_GLOBAL, iter, &iter->global_code, NULL, NULL, NULL, This->ctx->global, 0, NULL, NULL); leave_script(This->ctx, hres); } @@ -818,8 +808,6 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface, if(dwFlags & SCRIPTTEXT_ISEXPRESSION) { jsval_t r; - IActiveScriptSite_OnEnterScript(This->site); - hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, NULL, This->ctx->global, 0, NULL, &r); if(SUCCEEDED(hres)) { if(pvarResult) @@ -827,7 +815,6 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface, jsval_release(r); } - IActiveScriptSite_OnLeaveScript(This->site); return leave_script(This->ctx, hres); } @@ -840,8 +827,7 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface, if(!pvarResult && !is_started(This->ctx)) { list_add_tail(&This->queued_code, &code->entry); }else { - hres = exec_global_code(This, code); - + hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, NULL, This->ctx->global, 0, NULL, NULL); if(code->is_persistent) list_add_tail(&This->persistent_code, &code->entry); else diff --git a/dlls/jscript/tests/caller.c b/dlls/jscript/tests/caller.c index 9fb59844c4..19323e8eaf 100644 --- a/dlls/jscript/tests/caller.c +++ b/dlls/jscript/tests/caller.c @@ -105,9 +105,7 @@ static void _call_change_type(unsigned line, IVariantChangeType *change_type, VA ok_(__FILE__,line)(hres == S_OK, "ChangeType(%d) failed: %08x\n", vt, hres); ok_(__FILE__,line)(V_VT(dst) == vt, "V_VT(dst) = %d\n", V_VT(dst)); if(V_VT(src) == VT_DISPATCH && vt != VT_BOOL) { - todo_wine CHECK_CALLED(OnEnterScript); - todo_wine CHECK_CALLED(OnLeaveScript); } }
1
0
0
0
Jacek Caban : jscript: Store error code in jsexcept_t.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: 9855c248f844e2903a5fe866f41e112e1a5d084c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9855c248f844e2903a5fe866…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jan 30 15:50:33 2020 +0100 jscript: Store error code in jsexcept_t. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 19 +++++++++++++++++++ dlls/jscript/engine.h | 2 ++ dlls/jscript/jscript.c | 3 +++ dlls/jscript/jscript.h | 1 + dlls/jscript/jscript.rc | 1 + dlls/jscript/resource.h | 1 + po/ar.po | 24 ++++++++++++++---------- po/ast.po | 24 ++++++++++++++---------- po/bg.po | 24 ++++++++++++++---------- po/ca.po | 24 ++++++++++++++---------- po/cs.po | 24 ++++++++++++++---------- po/da.po | 24 ++++++++++++++---------- po/de.po | 24 ++++++++++++++---------- po/el.po | 24 ++++++++++++++---------- po/en.po | 24 ++++++++++++++---------- po/en_US.po | 24 ++++++++++++++---------- po/eo.po | 24 ++++++++++++++---------- po/es.po | 24 ++++++++++++++---------- po/fa.po | 24 ++++++++++++++---------- po/fi.po | 24 ++++++++++++++---------- po/fr.po | 24 ++++++++++++++---------- po/he.po | 24 ++++++++++++++---------- po/hi.po | 24 ++++++++++++++---------- po/hr.po | 24 ++++++++++++++---------- po/hu.po | 24 ++++++++++++++---------- po/it.po | 24 ++++++++++++++---------- po/ja.po | 24 ++++++++++++++---------- po/ko.po | 24 ++++++++++++++---------- po/lt.po | 24 ++++++++++++++---------- po/ml.po | 24 ++++++++++++++---------- po/nb_NO.po | 24 ++++++++++++++---------- po/nl.po | 24 ++++++++++++++---------- po/or.po | 24 ++++++++++++++---------- po/pa.po | 24 ++++++++++++++---------- po/pl.po | 24 ++++++++++++++---------- po/pt_BR.po | 24 ++++++++++++++---------- po/pt_PT.po | 24 ++++++++++++++---------- po/rm.po | 24 ++++++++++++++---------- po/ro.po | 24 ++++++++++++++---------- po/ru.po | 24 ++++++++++++++---------- po/si.po | 24 ++++++++++++++---------- po/sk.po | 24 ++++++++++++++---------- po/sl.po | 24 ++++++++++++++---------- po/sr_RS(a)cyrillic.po | 24 ++++++++++++++---------- po/sr_RS(a)latin.po | 24 ++++++++++++++---------- po/sv.po | 24 ++++++++++++++---------- po/ta.po | 24 ++++++++++++++---------- po/te.po | 24 ++++++++++++++---------- po/th.po | 24 ++++++++++++++---------- po/tr.po | 24 ++++++++++++++---------- po/uk.po | 24 ++++++++++++++---------- po/wa.po | 24 ++++++++++++++---------- po/wine.pot | 24 ++++++++++++++---------- po/zh_CN.po | 24 ++++++++++++++---------- po/zh_TW.po | 24 ++++++++++++++---------- 55 files changed, 713 insertions(+), 490 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=9855c248f844e2903a5f…
1
0
0
0
Jacek Caban : jscript: Store separated flag indicating if current exception value is valid.
by Alexandre Julliard
30 Jan '20
30 Jan '20
Module: wine Branch: master Commit: 3c9b7011ffc52cba78171576617217640ec9a091 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3c9b7011ffc52cba78171576…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jan 30 15:50:22 2020 +0100 jscript: Store separated flag indicating if current exception value is valid. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/engine.c | 27 ++++++++++++++++++++------- dlls/jscript/engine.h | 2 ++ dlls/jscript/error.c | 3 ++- dlls/jscript/jscript.c | 6 ++++-- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index b277f8631c..41d422ad98 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -855,13 +855,21 @@ static HRESULT interp_case(script_ctx_t *ctx) return S_OK; } +static void set_error_value(script_ctx_t *ctx, jsval_t value) +{ + jsexcept_t *ei = ctx->ei; + + reset_ei(ei); + ei->valid_value = TRUE; + ei->value = value; +} + /* ECMA-262 3rd Edition 12.13 */ static HRESULT interp_throw(script_ctx_t *ctx) { TRACE("\n"); - jsval_release(ctx->ei->value); - ctx->ei->value = stack_pop(ctx); + set_error_value(ctx, stack_pop(ctx)); return DISP_E_EXCEPTION; } @@ -957,7 +965,7 @@ static HRESULT interp_end_finally(script_ctx_t *ctx) if(!get_bool(v)) { TRACE("passing exception\n"); - ctx->ei->value = stack_pop(ctx); + set_error_value(ctx, stack_pop(ctx)); return DISP_E_EXCEPTION; } @@ -2713,6 +2721,7 @@ static void print_backtrace(script_ctx_t *ctx) static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) { except_frame_t *except_frame; + jsexcept_t *ei = ctx->ei; call_frame_t *frame; jsval_t except_val; unsigned catch_off; @@ -2724,8 +2733,8 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) static const WCHAR messageW[] = {'m','e','s','s','a','g','e',0}; - WARN("Exception %08x %s", exception_hres, debugstr_jsval(ctx->ei->value)); - if(jsval_type(ctx->ei->value) == JSV_OBJECT) { + WARN("Exception %08x %s", exception_hres, debugstr_jsval(ei->valid_value ? ei->value : jsval_undefined())); + if(ei->valid_value && jsval_type(ctx->ei->value) == JSV_OBJECT) { error_obj = to_jsdisp(get_object(ctx->ei->value)); if(error_obj) { hres = jsdisp_propget_name(error_obj, messageW, &msg); @@ -2766,8 +2775,12 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) frame->ip = catch_off ? catch_off : except_frame->finally_off; if(catch_off) assert(frame->bytecode->instrs[frame->ip].op == OP_enter_catch); - except_val = ctx->ei->value; - ctx->ei->value = jsval_undefined(); + if(ei->valid_value) { + except_val = ctx->ei->value; + ctx->ei->valid_value = FALSE; + }else { + except_val = jsval_undefined(); + } /* keep current except_frame if we're entering catch block with finally block associated */ if(catch_off && except_frame->finally_off) { diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 172f03323f..82abfeb743 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -222,7 +222,9 @@ static inline scope_chain_t *scope_addref(scope_chain_t *scope) } struct _jsexcept_t { + BOOL valid_value; jsval_t value; + jsexcept_t *prev; }; diff --git a/dlls/jscript/error.c b/dlls/jscript/error.c index 847f6de92d..66dbccfbc0 100644 --- a/dlls/jscript/error.c +++ b/dlls/jscript/error.c @@ -404,7 +404,8 @@ static HRESULT throw_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str, j if(FAILED(hres)) return hres; - jsval_release(ctx->ei->value); + reset_ei(ctx->ei); + ctx->ei->valid_value = TRUE; ctx->ei->value = jsval_obj(err); return error; } diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index 552861b130..e9f214f07a 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -103,8 +103,10 @@ static inline BOOL is_started(script_ctx_t *ctx) void reset_ei(jsexcept_t *ei) { - jsval_release(ei->value); - ei->value = jsval_undefined(); + if(ei->valid_value) { + jsval_release(ei->value); + ei->valid_value = FALSE; + } } void enter_script(script_ctx_t *ctx, jsexcept_t *ei)
1
0
0
0
← Newer
1
2
3
4
5
...
54
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
Results per page:
10
25
50
100
200