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
May 2024
----- 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
705 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Use DISPEX_IDISPATCH_IMPL macro in htmlbody.c.
by Alexandre Julliard
13 May '24
13 May '24
Module: wine Branch: master Commit: 87215839b0a1233f55a06d872b6735f398c561ca URL:
https://gitlab.winehq.org/wine/wine/-/commit/87215839b0a1233f55a06d872b6735…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 13 14:39:51 2024 +0200 mshtml: Use DISPEX_IDISPATCH_IMPL macro in htmlbody.c. --- dlls/mshtml/htmlbody.c | 108 ++----------------------------------------------- 1 file changed, 4 insertions(+), 104 deletions(-) diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index fa4284da8cc..135712afcd2 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -195,60 +195,8 @@ static inline HTMLBodyElement *impl_from_IHTMLBodyElement(IHTMLBodyElement *ifac return CONTAINING_RECORD(iface, HTMLBodyElement, IHTMLBodyElement_iface); } -static HRESULT WINAPI HTMLBodyElement_QueryInterface(IHTMLBodyElement *iface, - REFIID riid, void **ppv) -{ - HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); - - return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv); -} - -static ULONG WINAPI HTMLBodyElement_AddRef(IHTMLBodyElement *iface) -{ - HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); - - return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface); -} - -static ULONG WINAPI HTMLBodyElement_Release(IHTMLBodyElement *iface) -{ - HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); - - return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface); -} - -static HRESULT WINAPI HTMLBodyElement_GetTypeInfoCount(IHTMLBodyElement *iface, UINT *pctinfo) -{ - HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); - return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, - pctinfo); -} - -static HRESULT WINAPI HTMLBodyElement_GetTypeInfo(IHTMLBodyElement *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) -{ - HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); - return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, - lcid, ppTInfo); -} - -static HRESULT WINAPI HTMLBodyElement_GetIDsOfNames(IHTMLBodyElement *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) -{ - HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); - return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, - rgszNames, cNames, lcid, rgDispId); -} - -static HRESULT WINAPI HTMLBodyElement_Invoke(IHTMLBodyElement *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface); - return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, - riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); -} +DISPEX_IDISPATCH_IMPL(HTMLBodyElement, IHTMLBodyElement, + impl_from_IHTMLBodyElement(iface)->element.node.event_target.dispex) static HRESULT WINAPI HTMLBodyElement_put_background(IHTMLBodyElement *iface, BSTR v) { @@ -739,56 +687,8 @@ static inline HTMLBodyElement *impl_from_IHTMLTextContainer(IHTMLTextContainer * return CONTAINING_RECORD(iface, HTMLBodyElement, IHTMLTextContainer_iface); } -static HRESULT WINAPI HTMLTextContainer_QueryInterface(IHTMLTextContainer *iface, - REFIID riid, void **ppv) -{ - HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface); - return IHTMLElement_QueryInterface(&This->element.IHTMLElement_iface, riid, ppv); -} - -static ULONG WINAPI HTMLTextContainer_AddRef(IHTMLTextContainer *iface) -{ - HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface); - return IHTMLElement_AddRef(&This->element.IHTMLElement_iface); -} - -static ULONG WINAPI HTMLTextContainer_Release(IHTMLTextContainer *iface) -{ - HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface); - return IHTMLElement_Release(&This->element.IHTMLElement_iface); -} - -static HRESULT WINAPI HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer *iface, UINT *pctinfo) -{ - HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface); - return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo); -} - -static HRESULT WINAPI HTMLTextContainer_GetTypeInfo(IHTMLTextContainer *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) -{ - HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface); - return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, - ppTInfo); -} - -static HRESULT WINAPI HTMLTextContainer_GetIDsOfNames(IHTMLTextContainer *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) -{ - HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface); - return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames, - cNames, lcid, rgDispId); -} - -static HRESULT WINAPI HTMLTextContainer_Invoke(IHTMLTextContainer *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - HTMLBodyElement *This = impl_from_IHTMLTextContainer(iface); - return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid, - lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); -} +DISPEX_IDISPATCH_IMPL(HTMLTextContainer, IHTMLTextContainer, + impl_from_IHTMLTextContainer(iface)->element.node.event_target.dispex) static HRESULT WINAPI HTMLTextContainer_createControlRange(IHTMLTextContainer *iface, IDispatch **range)
1
0
0
0
Jacek Caban : mshtml: Use DISPEX_IDISPATCH_IMPL macro in htmlnode.c.
by Alexandre Julliard
13 May '24
13 May '24
Module: wine Branch: master Commit: 4819828683906501d7cd76515c4cab78f32c6440 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4819828683906501d7cd76515c4cab…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 13 14:37:39 2024 +0200 mshtml: Use DISPEX_IDISPATCH_IMPL macro in htmlnode.c. --- dlls/mshtml/htmlnode.c | 203 ++----------------------------------------------- 1 file changed, 5 insertions(+), 198 deletions(-)
1
0
0
0
Jacek Caban : mshtml: Introduce DISPEX_IDISPATCH_IMPL.
by Alexandre Julliard
13 May '24
13 May '24
Module: wine Branch: master Commit: 27fea2eefcf5dd99a8f26d0179d630e63bd29670 URL:
https://gitlab.winehq.org/wine/wine/-/commit/27fea2eefcf5dd99a8f26d0179d630…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 13 13:52:06 2024 +0200 mshtml: Introduce DISPEX_IDISPATCH_IMPL. And use it for HTMLRect object implementation. --- dlls/mshtml/htmlelem.c | 100 +------------------------------------------ dlls/mshtml/mshtml_private.h | 35 +++++++++++++++ 2 files changed, 37 insertions(+), 98 deletions(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index aa635200f7f..b2d1c544d0a 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -537,57 +537,7 @@ static inline HTMLRect *impl_from_IHTMLRect(IHTMLRect *iface) return CONTAINING_RECORD(iface, HTMLRect, IHTMLRect_iface); } -static HRESULT WINAPI HTMLRect_QueryInterface(IHTMLRect *iface, REFIID riid, void **ppv) -{ - HTMLRect *This = impl_from_IHTMLRect(iface); - return IDispatchEx_QueryInterface(&This->dispex.IDispatchEx_iface, riid, ppv); -} - -static ULONG WINAPI HTMLRect_AddRef(IHTMLRect *iface) -{ - HTMLRect *This = impl_from_IHTMLRect(iface); - return IDispatchEx_AddRef(&This->dispex.IDispatchEx_iface); -} - -static ULONG WINAPI HTMLRect_Release(IHTMLRect *iface) -{ - HTMLRect *This = impl_from_IHTMLRect(iface); - return IDispatchEx_Release(&This->dispex.IDispatchEx_iface); -} - -static HRESULT WINAPI HTMLRect_GetTypeInfoCount(IHTMLRect *iface, UINT *pctinfo) -{ - HTMLRect *This = impl_from_IHTMLRect(iface); - FIXME("(%p)->(%p)\n", This, pctinfo); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLRect_GetTypeInfo(IHTMLRect *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) -{ - HTMLRect *This = impl_from_IHTMLRect(iface); - - return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); -} - -static HRESULT WINAPI HTMLRect_GetIDsOfNames(IHTMLRect *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) -{ - HTMLRect *This = impl_from_IHTMLRect(iface); - - return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames, - lcid, rgDispId); -} - -static HRESULT WINAPI HTMLRect_Invoke(IHTMLRect *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - HTMLRect *This = impl_from_IHTMLRect(iface); - - return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, - pDispParams, pVarResult, pExcepInfo, puArgErr); -} +DISPEX_IDISPATCH_IMPL(HTMLRect, IHTMLRect, impl_from_IHTMLRect(iface)->dispex) static HRESULT WINAPI HTMLRect_put_left(IHTMLRect *iface, LONG v) { @@ -694,53 +644,7 @@ static inline HTMLRect *impl_from_IHTMLRect2(IHTMLRect2 *iface) return CONTAINING_RECORD(iface, HTMLRect, IHTMLRect2_iface); } -static HRESULT WINAPI HTMLRect2_QueryInterface(IHTMLRect2 *iface, REFIID riid, void **ppv) -{ - HTMLRect *This = impl_from_IHTMLRect2(iface); - return IHTMLRect_QueryInterface(&This->IHTMLRect_iface, riid, ppv); -} - -static ULONG WINAPI HTMLRect2_AddRef(IHTMLRect2 *iface) -{ - HTMLRect *This = impl_from_IHTMLRect2(iface); - return IHTMLRect_AddRef(&This->IHTMLRect_iface); -} - -static ULONG WINAPI HTMLRect2_Release(IHTMLRect2 *iface) -{ - HTMLRect *This = impl_from_IHTMLRect2(iface); - return IHTMLRect_Release(&This->IHTMLRect_iface); -} - -static HRESULT WINAPI HTMLRect2_GetTypeInfoCount(IHTMLRect2 *iface, UINT *pctinfo) -{ - HTMLRect *This = impl_from_IHTMLRect2(iface); - return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo); -} - -static HRESULT WINAPI HTMLRect2_GetTypeInfo(IHTMLRect2 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) -{ - HTMLRect *This = impl_from_IHTMLRect2(iface); - return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); -} - -static HRESULT WINAPI HTMLRect2_GetIDsOfNames(IHTMLRect2 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) -{ - HTMLRect *This = impl_from_IHTMLRect2(iface); - return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames, - lcid, rgDispId); -} - -static HRESULT WINAPI HTMLRect2_Invoke(IHTMLRect2 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - HTMLRect *This = impl_from_IHTMLRect2(iface); - return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, - pDispParams, pVarResult, pExcepInfo, puArgErr); -} +DISPEX_IDISPATCH_IMPL(HTMLRect2, IHTMLRect2, impl_from_IHTMLRect2(iface)->dispex) static HRESULT WINAPI HTMLRect2_get_width(IHTMLRect2 *iface, FLOAT *p) { diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 36d6dfd646a..1d4f005ba11 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -412,6 +412,41 @@ struct DispatchEx { dispex_dynamic_data_t *dynamic_data; }; +#define DISPEX_IDISPATCH_IMPL(prefix, iface_name, dispex) \ + static HRESULT WINAPI prefix##_QueryInterface(iface_name *iface, REFIID riid, void **ppv) \ + { \ + return IDispatchEx_QueryInterface(&(dispex).IDispatchEx_iface, riid, ppv); \ + } \ + static ULONG WINAPI prefix##_AddRef(iface_name *iface) \ + { \ + return IDispatchEx_AddRef(&(dispex).IDispatchEx_iface); \ + } \ + static ULONG WINAPI prefix##_Release(iface_name *iface) \ + { \ + return IDispatchEx_Release(&(dispex).IDispatchEx_iface); \ + } \ + static HRESULT WINAPI prefix##_GetTypeInfoCount(iface_name *iface, UINT *count) \ + { \ + return IDispatchEx_GetTypeInfoCount(&(dispex).IDispatchEx_iface, count); \ + } \ + static HRESULT WINAPI prefix##_GetTypeInfo(iface_name *iface, \ + UINT index, LCID lcid, ITypeInfo **ret) \ + { \ + return IDispatchEx_GetTypeInfo(&(dispex).IDispatchEx_iface, index, lcid, ret); \ + } \ + static HRESULT WINAPI prefix##_GetIDsOfNames(iface_name *iface, REFIID riid, \ + LPOLESTR *names, UINT count, LCID lcid, DISPID *dispid) \ + { \ + return IDispatchEx_GetIDsOfNames(&(dispex).IDispatchEx_iface, \ + riid, names, count, lcid, dispid); \ + } \ + static HRESULT WINAPI prefix##_Invoke(iface_name *iface, DISPID dispid, REFIID riid, \ + LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, UINT *err) \ + { \ + return IDispatchEx_Invoke(&(dispex).IDispatchEx_iface, dispid, \ + riid, lcid, flags, params, res, ei, err); \ + } + typedef struct { void *vtbl; int ref_flags;
1
0
0
0
Jacek Caban : d3dx9/tests: Remove xfile dumping functionality.
by Alexandre Julliard
13 May '24
13 May '24
Module: wine Branch: master Commit: 7b15890fe8edd99d4345697fdb8f0303f8fb9261 URL:
https://gitlab.winehq.org/wine/wine/-/commit/7b15890fe8edd99d4345697fdb8f03…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sat Dec 9 11:30:26 2023 +0100 d3dx9/tests: Remove xfile dumping functionality. --- dlls/d3dx9_36/tests/xfile.c | 138 -------------------------------------------- 1 file changed, 138 deletions(-) diff --git a/dlls/d3dx9_36/tests/xfile.c b/dlls/d3dx9_36/tests/xfile.c index 0a40e4fbb60..0a04544a4bf 100644 --- a/dlls/d3dx9_36/tests/xfile.c +++ b/dlls/d3dx9_36/tests/xfile.c @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include <stdio.h> - #include "wine/test.h" #include "d3dx9.h" #include "d3dx9xof.h" @@ -244,146 +242,10 @@ static void test_type_index_color(void) d3dxfile->lpVtbl->Release(d3dxfile); } -static void process_data(ID3DXFileData *xfile_data, int level) -{ - HRESULT ret; - char name[100]; - GUID clsid; - GUID clsid_type; - SIZE_T len = sizeof(name); - int i; - const BYTE *data; - SIZE_T size; - SIZE_T children; - - ret = xfile_data->lpVtbl->GetId(xfile_data, &clsid); - ok(ret == S_OK, "ID3DXFileData_GetId failed with %#lx\n", ret); - ret = xfile_data->lpVtbl->GetName(xfile_data, name, &len); - ok(ret == S_OK, "ID3DXFileData_GetName failed with %#lx\n", ret); - ret = xfile_data->lpVtbl->GetType(xfile_data, &clsid_type); - ok(ret == S_OK, "IDirectXFileData_GetType failed with %#lx\n", ret); - ret = xfile_data->lpVtbl->Lock(xfile_data, &size, (const void**)&data); - ok(ret == S_OK, "IDirectXFileData_Lock failed with %#lx\n", ret); - - for (i = 0; i < level; i++) - printf(" "); - - printf("Found object '%s' - %s - %s - %Iu\n", - len ? name : "", wine_dbgstr_guid(&clsid), wine_dbgstr_guid(&clsid_type), size); - - if (size) - { - int j; - for (j = 0; j < size; j++) - { - if (j && !(j%16)) - printf("\n"); - printf("%02x ", data[j]); - } - printf("\n"); - } - - ret = xfile_data->lpVtbl->Unlock(xfile_data); - ok(ret == S_OK, "ID3DXFileData_Unlock failed with %#lx\n", ret); - - ret = xfile_data->lpVtbl->GetChildren(xfile_data, &children); - ok(ret == S_OK, "ID3DXFileData_GetChildren failed with %#lx\n", ret); - - level++; - - for (i = 0; i < children; i++) - { - ID3DXFileData *child; - int j; - - ret = xfile_data->lpVtbl->GetChild(xfile_data, i, &child); - ok(ret == S_OK, "ID3DXFileData_GetChild failed with %#lx\n", ret); - for (j = 0; j < level; j++) - printf(" "); - if (child->lpVtbl->IsReference(child)) - printf("Found Data Reference (%d)\n", i + 1); - else - printf("Found Data (%d)\n", i + 1); - - process_data(child, level); - - child->lpVtbl->Release(child); - } -} - -/* Dump an X file 'objects.x' and its related templates file 'templates.x' if they are both presents - * Useful for debug by comparing outputs from native and builtin dlls */ -static void test_dump(void) -{ - HRESULT ret; - ULONG ref; - ID3DXFile *xfile = NULL; - ID3DXFileEnumObject *xfile_enum_object = NULL; - HANDLE file; - void *data; - DWORD size; - SIZE_T children; - int i; - - /* Dump data only if there is an object and a template */ - file = CreateFileA("objects.x", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - if (file == INVALID_HANDLE_VALUE) - return; - CloseHandle(file); - - file = CreateFileA("templates.x", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - if (file == INVALID_HANDLE_VALUE) - return; - - data = calloc(1, 10000); - - if (!ReadFile(file, data, 10000, &size, NULL)) - { - skip("Templates file is too big\n"); - goto exit; - } - - printf("Load templates file (%lu bytes)\n", size); - - ret = D3DXFileCreate(&xfile); - ok(ret == S_OK, "D3DXCreateFile failed with %#lx\n", ret); - - ret = xfile->lpVtbl->RegisterTemplates(xfile, data, size); - ok(ret == S_OK, "ID3DXFileImpl_RegisterTemplates failed with %#lx\n", ret); - - ret = xfile->lpVtbl->CreateEnumObject(xfile, (void*)"objects.x", D3DXF_FILELOAD_FROMFILE, &xfile_enum_object); - ok(ret == S_OK, "ID3DXFile_CreateEnumObject failed with %#lx\n", ret); - - ret = xfile_enum_object->lpVtbl->GetChildren(xfile_enum_object, &children); - ok(ret == S_OK, "ID3DXFileEnumObject_GetChildren failed with %#lx\n", ret); - - for (i = 0; i < children; i++) - { - ID3DXFileData *child; - ret = xfile_enum_object->lpVtbl->GetChild(xfile_enum_object, i, &child); - ok(ret == S_OK, "ID3DXFileEnumObject_GetChild failed with %#lx\n", ret); - printf("\n"); - process_data(child, 0); - child->lpVtbl->Release(child); - } - - ref = xfile_enum_object->lpVtbl->Release(xfile_enum_object); - ok(ref == 0, "Got refcount %lu, expected 0\n", ref); - - ref = xfile->lpVtbl->Release(xfile); - ok(ref == 0, "Got refcount %lu, expected 0\n", ref); - - -exit: - CloseHandle(file); - free(data); -} - START_TEST(xfile) { test_templates(); test_lock_unlock(); test_getname(); test_type_index_color(); - test_dump(); }
1
0
0
0
Alexandre Julliard : ntdll: Add processor information to the SMBIOS data.
by Alexandre Julliard
13 May '24
13 May '24
Module: wine Branch: master Commit: dd4514a26bb411aaf4391accc63c2d779835b1ef URL:
https://gitlab.winehq.org/wine/wine/-/commit/dd4514a26bb411aaf4391accc63c2d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon May 13 11:54:17 2024 +0200 ntdll: Add processor information to the SMBIOS data. --- dlls/ntdll/unix/system.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index d5556c0d42a..dcfc2ebd980 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -158,6 +158,37 @@ struct smbios_chassis BYTE contained_element_rec_length; }; +struct smbios_processor +{ + struct smbios_header hdr; + BYTE socket; + BYTE type; + BYTE family; + BYTE vendor; + ULONGLONG id; + BYTE version; + BYTE voltage; + WORD clock; + WORD max_speed; + WORD cur_speed; + BYTE status; + BYTE upgrade; + WORD l1cache; + WORD l2cache; + WORD l3cache; + BYTE serial; + BYTE asset_tag; + BYTE part_number; + BYTE core_count; + BYTE core_enabled; + BYTE thread_count; + WORD characteristics; + WORD family2; + WORD core_count2; + WORD core_enabled2; + WORD thread_count2; +}; + struct smbios_boot_info { struct smbios_header hdr; @@ -173,6 +204,7 @@ enum smbios_type SMBIOS_TYPE_SYSTEM = 1, SMBIOS_TYPE_BASEBOARD = 2, SMBIOS_TYPE_CHASSIS = 3, + SMBIOS_TYPE_PROCESSOR = 4, SMBIOS_TYPE_BOOTINFO = 32, SMBIOS_TYPE_END = 127 }; @@ -1561,6 +1593,40 @@ static WORD append_smbios_board( struct smbios_buffer *buf, WORD chassis_handle, return append_smbios( buf, &board.hdr, strings, string_count ); } +static WORD append_smbios_processor( struct smbios_buffer *buf, WORD core_count, WORD thread_count, + WORD family, const char *socket, const char *vendor, + const char *version, const char *serial, const char *asset_tag ) +{ + const char *strings[5]; + unsigned int string_count = 0; + struct smbios_processor proc = { .hdr.type = SMBIOS_TYPE_PROCESSOR, .hdr.length = sizeof(proc) }; + + proc.socket = ADD_STR( socket ); + proc.type = 3; /* central processor */ + proc.family = family ? min( family, 0xfe ) : 2; /* unknown */ + proc.vendor = ADD_STR( vendor ); + proc.id = cpu_id; + proc.version = ADD_STR( version ); + proc.status = 0x41; /* cpu enabled */ + proc.upgrade = 2; /* unknown */ + proc.l1cache = 0xffff; /* unknown */ + proc.l2cache = 0xffff; /* unknown */ + proc.l3cache = 0xffff; /* unknown */ + proc.serial = ADD_STR( serial ); + proc.asset_tag = ADD_STR( asset_tag ); + proc.core_count = min( core_count, 0xff ); + proc.core_enabled = min( core_count, 0xff ); + proc.thread_count = min( thread_count, 0xff ); + proc.family2 = family ? family : 2; + proc.core_count2 = core_count; + proc.core_enabled2 = core_count; + proc.thread_count2 = thread_count; + if (sizeof(void *) > sizeof(int)) proc.characteristics |= 1 << 2; /* 64-bit */ + if (core_count > 1) proc.characteristics |= 1 << 3; /* multi-core */ + if (thread_count > core_count) proc.characteristics |= 1 << 4; /* multi-thread */ + return append_smbios( buf, &proc.hdr, strings, string_count ); +} + static WORD append_smbios_boot_info( struct smbios_buffer *buf ) { struct smbios_boot_info boot = { .hdr.type = SMBIOS_TYPE_BOOTINFO, .hdr.length = sizeof(boot) }; @@ -1575,6 +1641,41 @@ static void append_smbios_end( struct smbios_buffer *buf ) append_smbios( buf, &end, NULL, 0 ); } +static void create_smbios_processors( struct smbios_buffer *buf ) +{ + char socket[20], name[49]; + SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *p = logical_proc_info_ex; + UINT i, family = 0, core_count = 0, thread_count = 0, pkg_count = 0; + + strcpy( name, cpu_name ); + for (i = strlen(name); i > 0 && name[i - 1] == ' '; i--) name[i - 1] = 0; + + while ((char *)p != (char *)logical_proc_info_ex + logical_proc_info_ex_size) + { + switch (p->Relationship) + { + case RelationProcessorPackage: + if (!pkg_count++) break; + snprintf( socket, sizeof(socket), "Socket #%u", pkg_count - 1 ); + append_smbios_processor( buf, core_count, thread_count, family, + socket, cpu_vendor, name, "", "" ); + core_count = thread_count = 0; + break; + case RelationProcessorCore: + core_count++; + thread_count++; + if (p->Processor.Flags & LTP_PC_SMT) thread_count++; + break; + default: + break; + } + p = (SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *)((char *)p + p->Size); + } + snprintf( socket, sizeof(socket), "Socket #%u", pkg_count - 1 ); + append_smbios_processor( buf, core_count, thread_count, family, + socket, cpu_vendor, name, "", "" ); +} + #undef ADD_STR #ifdef linux @@ -1673,6 +1774,7 @@ static struct smbios_prologue *create_smbios_data(void) get_smbios_string( "/sys/class/dmi/id/board_asset_tag", S(asset_tag) )); #undef S + create_smbios_processors( &buf ); append_smbios_boot_info( &buf ); append_smbios_end( &buf ); return buf.prologue; @@ -1807,6 +1909,7 @@ static struct smbios_prologue *create_smbios_data(void) append_smbios_system( &buf, manufacturer, model, "1.0", serial_number, "", model, &system_uuid ); chassis = append_smbios_chassis( &buf, 0, manufacturer, "", serial_number, "" ); append_smbios_board( &buf, chassis, manufacturer, model, model, serial_number, "" ); + create_smbios_processors( &buf ); append_smbios_boot_info( &buf ); append_smbios_end( &buf ); return buf.prologue; @@ -1828,6 +1931,7 @@ static struct smbios_prologue *create_smbios_data(void) append_smbios_system( &buf, vendor, product, version, serial, "", "", &uuid ); chassis = append_smbios_chassis( &buf, 0, vendor, version, serial, "" ); append_smbios_board( &buf, chassis, vendor, product, version, serial, "" ); + create_smbios_processors( &buf ); append_smbios_boot_info( &buf ); append_smbios_end( &buf ); return buf.prologue;
1
0
0
0
Alexandre Julliard : ntdll: Store the CPU vendor and id during detection.
by Alexandre Julliard
13 May '24
13 May '24
Module: wine Branch: master Commit: 7f9cad6979b43b4e538cf5786ecd7bde871680fe URL:
https://gitlab.winehq.org/wine/wine/-/commit/7f9cad6979b43b4e538cf5786ecd7b…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon May 13 11:53:10 2024 +0200 ntdll: Store the CPU vendor and id during detection. --- dlls/ntdll/unix/system.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 280d1b7323a..d5556c0d42a 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -188,6 +188,8 @@ enum smbios_type SYSTEM_CPU_INFORMATION cpu_info = { 0 }; static SYSTEM_PROCESSOR_FEATURES_INFORMATION cpu_features; static char cpu_name[49]; +static char cpu_vendor[13]; +static ULONGLONG cpu_id; static ULONG *performance_cores; static unsigned int performance_cores_capacity = 0; static SYSTEM_LOGICAL_PROCESSOR_INFORMATION *logical_proc_info; @@ -265,14 +267,6 @@ void copy_xstate( XSAVE_AREA_HEADER *dst, XSAVE_AREA_HEADER *src, UINT64 mask ) } } -#define AUTH 0x68747541 /* "Auth" */ -#define ENTI 0x69746e65 /* "enti" */ -#define CAMD 0x444d4163 /* "cAMD" */ - -#define GENU 0x756e6547 /* "Genu" */ -#define INEI 0x49656e69 /* "ineI" */ -#define NTEL 0x6c65746e /* "ntel" */ - extern void do_cpuid( unsigned int ax, unsigned int cx, unsigned int *p ); #ifdef __i386__ __ASM_GLOBAL_FUNC( do_cpuid, @@ -396,6 +390,9 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info ) if (!have_cpuid()) return; do_cpuid( 0x00000000, 0, regs ); /* get standard cpuid level and vendor name */ + memcpy( cpu_vendor, ®s[1], sizeof(unsigned int) ); + memcpy( cpu_vendor + 4, ®s[3], sizeof(unsigned int) ); + memcpy( cpu_vendor + 8, ®s[2], sizeof(unsigned int) ); if (regs[0]>=0x00000001) /* Check for supported cpuid version */ { do_cpuid( 0x00000001, 0, regs2 ); /* get cpu features */ @@ -421,6 +418,7 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info ) if((regs2[3] & (1 << 26)) && (regs2[3] & (1 << 24)) && have_sse_daz_mode()) /* has SSE2 and FXSAVE/FXRSTOR */ features |= CPU_FEATURE_DAZ; + cpu_id = regs2[0] | ((ULONGLONG)regs2[3] << 32); if (regs[0] >= 0x00000007) { do_cpuid( 0x00000007, 0, regs3 ); /* get extended features */ @@ -452,7 +450,7 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info ) TRACE("xstate_features_size %lld.\n", (long long)xstate_features_size); } - if (regs[1] == AUTH && regs[3] == ENTI && regs[2] == CAMD) + if (!strcmp( cpu_vendor, "AuthenticAMD" )) { info->ProcessorLevel = (regs2[0] >> 8) & 0xf; /* family */ if (info->ProcessorLevel == 0xf) /* AMD says to add the extended family to the family if family is 0xf */ @@ -474,7 +472,7 @@ static void get_cpuinfo( SYSTEM_CPU_INFORMATION *info ) } if (regs[0] >= 0x80000004) get_cpuid_name( cpu_name ); } - else if (regs[1] == GENU && regs[3] == INEI && regs[2] == NTEL) + else if (!strcmp( cpu_vendor, "GenuineIntel" )) { info->ProcessorLevel = ((regs2[0] >> 8) & 0xf) + ((regs2[0] >> 20) & 0xff); /* family + extended family */ if(info->ProcessorLevel == 15) info->ProcessorLevel = 6;
1
0
0
0
Elizabeth Figura : d3d9/tests: Test default attribute components.
by Alexandre Julliard
12 May '24
12 May '24
Module: wine Branch: master Commit: 040b2a9c75666527af6ca79d9146095c8ed6a3cf URL:
https://gitlab.winehq.org/wine/wine/-/commit/040b2a9c75666527af6ca79d914609…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Mon Feb 19 20:19:08 2024 -0600 d3d9/tests: Test default attribute components. --- dlls/d3d9/tests/visual.c | 156 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index ef6d831aef3..367c8a9a955 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -28535,6 +28535,161 @@ static void test_default_diffuse(void) release_test_context(&context); } +/* Test the default values of attribute components when the vertex declaration + * includes less than all 4 components. */ +static void test_default_attribute_components(void) +{ + IDirect3DVertexDeclaration9 *vertex_declaration; + struct d3d9_test_context context; + IDirect3DVertexShader9 *vs; + IDirect3DDevice9 *device; + HRESULT hr; + + static const DWORD vs_texcoord1_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x80010005, 0x900f0001, /* dcl_texcoord1 v1 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x02000001, 0xd00f0000, 0x90390001, /* mov oD0, v1.yzwx */ + 0x0000ffff /* end */ + }; + + static const DWORD vs_texcoord2_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x80020005, 0x900f0001, /* dcl_texcoord2 v1 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x02000001, 0xd00f0000, 0x90390001, /* mov oD0, v1.yzwx */ + 0x0000ffff /* end */ + }; + + static const DWORD vs_texcoord3_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x80030005, 0x900f0001, /* dcl_texcoord3 v1 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x02000001, 0xd00f0000, 0x90390001, /* mov oD0, v1.yzwx */ + 0x0000ffff /* end */ + }; + + static const DWORD vs_color1_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x8001000a, 0x900f0001, /* dcl_color1 v1 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x02000001, 0xd00f0000, 0x90390001, /* mov oD0, v1.yzwx */ + 0x0000ffff /* end */ + }; + + static const DWORD vs_color2_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x8002000a, 0x900f0001, /* dcl_color2 v1 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x02000001, 0xd00f0000, 0x90390001, /* mov oD0, v1.yzwx */ + 0x0000ffff /* end */ + }; + + static const DWORD vs_color3_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x8003000a, 0x900f0001, /* dcl_color3 v1 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x02000001, 0xd00f0000, 0x90390001, /* mov oD0, v1.yzwx */ + 0x0000ffff /* end */ + }; + + static const D3DVERTEXELEMENT9 decl_elements[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, + {0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 2}, + {0, 24, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 3}, + {0, 36, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1}, + {0, 40, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 2}, + {0, 48, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 3}, + D3DDECL_END() + }; + + static const struct + { + struct vec3 position; + float texcoord1; + struct vec2 texcoord2; + struct vec3 texcoord3; + float color1; + struct vec2 color2; + struct vec3 color3; + } + quad[] = + { + {{-1.0f, -1.0f, 0.1f}, 0.1f, {0.2f, 0.2f}, {0.3f, 0.3f, 0.3f}, 0.1f, {0.2f, 0.2f}, {0.3f, 0.3f, 0.3f}}, + {{-1.0f, 1.0f, 0.1f}, 0.1f, {0.2f, 0.2f}, {0.3f, 0.3f, 0.3f}, 0.1f, {0.2f, 0.2f}, {0.3f, 0.3f, 0.3f}}, + {{ 1.0f, -1.0f, 0.1f}, 0.1f, {0.2f, 0.2f}, {0.3f, 0.3f, 0.3f}, 0.1f, {0.2f, 0.2f}, {0.3f, 0.3f, 0.3f}}, + {{ 1.0f, 1.0f, 0.1f}, 0.1f, {0.2f, 0.2f}, {0.3f, 0.3f, 0.3f}, 0.1f, {0.2f, 0.2f}, {0.3f, 0.3f, 0.3f}}, + }; + + static const struct + { + const DWORD *vs_code; + D3DCOLOR color; + } + tests[] = + { + {vs_texcoord1_code, 0x0000ff}, + {vs_texcoord2_code, 0x3300ff}, + {vs_texcoord3_code, 0x4c4cff}, + {vs_color1_code, 0x0000ff}, + {vs_color2_code, 0x3300ff}, + {vs_color3_code, 0x4c4cff}, + }; + + if (!init_test_context(&context)) + return; + device = context.device; + + hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, vertex_declaration); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + for (unsigned int j = 0; j < ARRAY_SIZE(tests); ++j) + { + winetest_push_context("test %u", j); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IDirect3DDevice9_CreateVertexShader(device, tests[j].vs_code, &vs); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, vs); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quad, sizeof(*quad)); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + check_rt_color(context.backbuffer, tests[j].color); + + IDirect3DVertexShader9_Release(vs); + winetest_pop_context(); + } + + IDirect3DVertexDeclaration9_Release(vertex_declaration); + release_test_context(&context); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER9 identifier; @@ -28690,4 +28845,5 @@ START_TEST(visual) test_managed_generate_mipmap(); test_mipmap_upload(); test_default_diffuse(); + test_default_attribute_components(); }
1
0
0
0
Elizabeth Figura : d3d9/tests: Add some tests for default diffuse values.
by Alexandre Julliard
12 May '24
12 May '24
Module: wine Branch: master Commit: fe94c844fa06f4a6d367add031cb8cf047726f10 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fe94c844fa06f4a6d367add031cb8c…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Sat May 4 13:21:39 2024 -0500 d3d9/tests: Add some tests for default diffuse values. --- dlls/d3d9/tests/visual.c | 200 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index b670c4f49d6..ef6d831aef3 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -28336,6 +28336,205 @@ static void test_mipmap_upload(void) release_test_context(&context); } +static void test_default_diffuse(void) +{ + IDirect3DVertexDeclaration9 *vertex_declaration; + struct d3d9_test_context context; + IDirect3DVertexBuffer9 *vb; + IDirect3DDevice9 *device; + HRESULT hr; + void *data; + + static const D3DVERTEXELEMENT9 decl_elements_with_diffuse[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END() + }; + + static const D3DVERTEXELEMENT9 decl_elements_no_diffuse[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + D3DDECL_END() + }; + + static const D3DVERTEXELEMENT9 decl_elements_missing_diffuse[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {1, 0, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END() + }; + + static const DWORD vs_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x8000000a, 0x900f0001, /* dcl_color0 v1 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x02000001, 0xd00f0000, 0x90e40001, /* mov oD0, v1 */ + 0x0000ffff /* end */ + }; + + static const DWORD vs_no_diffuse_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x0000ffff /* end */ + }; + + static const DWORD ps_code[] = + { + 0xffff0200, /* ps_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl v0 */ + 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ + 0x0000ffff /* end */ + }; + + static const struct + { + struct vec3 position; + unsigned int diffuse; + } + quad[] = + { + {{-1.0f, -1.0f, 0.1f}, 0xff0000ff}, + {{-1.0f, 1.0f, 0.1f}, 0xff0000ff}, + {{ 1.0f, -1.0f, 0.1f}, 0xff0000ff}, + {{ 1.0f, 1.0f, 0.1f}, 0xff0000ff}, + }; + + static const struct + { + const DWORD *ps; + DWORD texture_source; + } + ps_tests[] = + { + {ps_code, 0}, + {NULL, D3DTA_CURRENT}, + {NULL, D3DTA_DIFFUSE}, + }; + + static const struct + { + const DWORD *vs; + const D3DVERTEXELEMENT9 *decl_elements; + unsigned int expect_colour; + } + vs_tests[] = + { + {NULL, decl_elements_with_diffuse, 0x000000ff}, + {NULL, decl_elements_no_diffuse, 0x00ffffff}, + {NULL, decl_elements_missing_diffuse, 0x00000000}, + {vs_code, decl_elements_with_diffuse, 0x000000ff}, + {vs_code, decl_elements_no_diffuse, 0x00000000}, + {vs_code, decl_elements_missing_diffuse, 0x00000000}, + {vs_no_diffuse_code, decl_elements_with_diffuse, 0x00ffffff}, + {vs_no_diffuse_code, decl_elements_no_diffuse, 0x00ffffff}, + {vs_no_diffuse_code, decl_elements_missing_diffuse, 0x00ffffff}, + }; + + if (!init_test_context(&context)) + return; + device = context.device; + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), + D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &vb, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirect3DVertexBuffer9_Lock(vb, 0, 0, &data, D3DLOCK_DISCARD); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + memcpy(data, quad, sizeof(quad)); + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad[0])); + ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr); + + for (unsigned int i = 0; i < ARRAY_SIZE(ps_tests); ++i) + { + winetest_push_context("PS test %u", i); + + if (ps_tests[i].ps) + { + IDirect3DPixelShader9 *ps; + + hr = IDirect3DDevice9_CreatePixelShader(device, ps_tests[i].ps, &ps); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, ps); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IDirect3DPixelShader9_Release(ps); + } + else + { + hr = IDirect3DDevice9_SetPixelShader(device, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, ps_tests[i].texture_source); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, ps_tests[i].texture_source); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + } + + for (unsigned int j = 0; j < ARRAY_SIZE(vs_tests); ++j) + { + unsigned int colour; + + winetest_push_context("VS test %u", j); + + if (vs_tests[j].vs) + { + IDirect3DVertexShader9 *vs; + + hr = IDirect3DDevice9_CreateVertexShader(device, vs_tests[j].vs, &vs); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, vs); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IDirect3DVertexShader9_Release(vs); + } + else + { + hr = IDirect3DDevice9_SetVertexShader(device, NULL); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + } + + hr = IDirect3DDevice9_CreateVertexDeclaration(device, vs_tests[j].decl_elements, &vertex_declaration); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, vertex_declaration); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IDirect3DVertexDeclaration9_Release(vertex_declaration); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + colour = getPixelColor(device, 320, 240); + todo_wine_if (j == 2) + ok(colour == vs_tests[j].expect_colour, "Got unexpected colour %08x.\n", colour); + + winetest_pop_context(); + } + + winetest_pop_context(); + } + + IDirect3DVertexShader9_Release(vb); + release_test_context(&context); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER9 identifier; @@ -28490,4 +28689,5 @@ START_TEST(visual) test_managed_reset(); test_managed_generate_mipmap(); test_mipmap_upload(); + test_default_diffuse(); }
1
0
0
0
Elizabeth Figura : d3d9/tests: Expand test_color_vertex().
by Alexandre Julliard
12 May '24
12 May '24
Module: wine Branch: master Commit: cad144a11fb0c9f4fffe7502ee4a67041652daf1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cad144a11fb0c9f4fffe7502ee4a67…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Tue Apr 30 19:22:11 2024 -0500 d3d9/tests: Expand test_color_vertex(). Test a stream present in the vertex declaration but not provided as a buffer. --- dlls/d3d9/tests/visual.c | 84 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 66 insertions(+), 18 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index c0cf9e3eea3..b670c4f49d6 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -25950,6 +25950,30 @@ static void test_color_vertex(void) HWND window; HRESULT hr; + static const D3DVERTEXELEMENT9 decl_elements_missing_diffuse[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1}, + {1, 0, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END() + }; + + static const D3DVERTEXELEMENT9 decl_elements_missing_specular[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, + {2, 0, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1}, + D3DDECL_END() + }; + + static const D3DVERTEXELEMENT9 decl_elements_missing_both[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {1, 0, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, + {2, 0, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1}, + D3DDECL_END() + }; + /* The idea here is to set up ambient light parameters in a way that the * ambient colour from the material is just passed through. The emissive * colour is just passed through anyway. The sum of ambient + emissive @@ -25959,27 +25983,36 @@ static void test_color_vertex(void) * in the struct will be fed into the specular vertex colour slot. */ static const struct { + const D3DVERTEXELEMENT9 *decl_elements; DWORD fvf, color_vertex, ambient, emissive; unsigned int result; } tests[] = { - {D3DFVF_DIFFUSE | D3DFVF_SPECULAR, FALSE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x000000c0}, + {NULL, D3DFVF_DIFFUSE | D3DFVF_SPECULAR, FALSE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x000000c0}, - {D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x00ffff00}, - {D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_MATERIAL, D3DMCS_COLOR2, 0x0000ff80}, - {D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_MATERIAL, 0x00ff0040}, - {D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR1, 0x00ff0000}, - {D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR2, D3DMCS_COLOR2, 0x0000ff00}, + {NULL, D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x00ffff00}, + {NULL, D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_MATERIAL, D3DMCS_COLOR2, 0x0000ff80}, + {NULL, D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_MATERIAL, 0x00ff0040}, + {NULL, D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR1, 0x00ff0000}, + {NULL, D3DFVF_DIFFUSE | D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR2, D3DMCS_COLOR2, 0x0000ff00}, - {D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x00ff0080}, - {D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_MATERIAL, 0x000000c0}, - {D3DFVF_SPECULAR, TRUE, D3DMCS_MATERIAL, D3DMCS_COLOR2, 0x00ff0080}, - {D3DFVF_DIFFUSE, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x00ff0040}, - {D3DFVF_DIFFUSE, TRUE, D3DMCS_COLOR1, D3DMCS_MATERIAL, 0x00ff0040}, - {D3DFVF_DIFFUSE, TRUE, D3DMCS_COLOR2, D3DMCS_MATERIAL, 0x000000c0}, + {NULL, D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x00ff0080}, + {NULL, D3DFVF_SPECULAR, TRUE, D3DMCS_COLOR1, D3DMCS_MATERIAL, 0x000000c0}, + {NULL, D3DFVF_SPECULAR, TRUE, D3DMCS_MATERIAL, D3DMCS_COLOR2, 0x00ff0080}, + {NULL, D3DFVF_DIFFUSE, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x00ff0040}, + {NULL, D3DFVF_DIFFUSE, TRUE, D3DMCS_COLOR1, D3DMCS_MATERIAL, 0x00ff0040}, + {NULL, D3DFVF_DIFFUSE, TRUE, D3DMCS_COLOR2, D3DMCS_MATERIAL, 0x000000c0}, - {0, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x000000c0}, + {NULL, 0, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x000000c0}, + + {decl_elements_missing_diffuse, 0, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x00ff0000}, + {decl_elements_missing_diffuse, 0, TRUE, D3DMCS_COLOR1, D3DMCS_MATERIAL, 0x00000040}, + {decl_elements_missing_diffuse, 0, TRUE, D3DMCS_MATERIAL, D3DMCS_COLOR2, 0x00ff0080}, + {decl_elements_missing_specular, 0, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x00ff0000}, + {decl_elements_missing_specular, 0, TRUE, D3DMCS_COLOR1, D3DMCS_MATERIAL, 0x00ff0040}, + {decl_elements_missing_specular, 0, TRUE, D3DMCS_MATERIAL, D3DMCS_COLOR2, 0x00000080}, + {decl_elements_missing_both, 0, TRUE, D3DMCS_COLOR1, D3DMCS_COLOR2, 0x00000000}, }; static const struct @@ -26028,8 +26061,22 @@ static void test_color_vertex(void) ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_EMISSIVEMATERIALSOURCE, tests[i].emissive); ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | tests[i].fvf); - ok(SUCCEEDED(hr), "Failed to set render state, hr %#lx.\n", hr); + + if (tests[i].decl_elements) + { + IDirect3DVertexDeclaration9 *vertex_declaration; + + hr = IDirect3DDevice9_CreateVertexDeclaration(device, tests[i].decl_elements, &vertex_declaration); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, vertex_declaration); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + IDirect3DVertexDeclaration9_Release(vertex_declaration); + } + else + { + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | tests[i].fvf); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + } hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x77777777, 0.0f, 0); ok(SUCCEEDED(hr), "Failed to clear depth/stencil, hr %#lx.\n", hr); @@ -26042,9 +26089,10 @@ static void test_color_vertex(void) ok(SUCCEEDED(hr), "Failed to end scene, hr %#lx.\n", hr); colour = getPixelColor(device, 320, 240); - ok(color_match(colour, tests[i].result, 1), - "Expected colour 0x%08x for test %u, got 0x%08x.\n", - tests[i].result, i, colour); + todo_wine_if (i == 13 || i == 14 || i == 16 || i == 18 || i == 19) + ok(color_match(colour, tests[i].result, 1), + "Expected colour 0x%08x for test %u, got 0x%08x.\n", + tests[i].result, i, colour); } refcount = IDirect3DDevice9_Release(device);
1
0
0
0
Elizabeth Figura : d3d9/tests: Clarify and expand point size tests.
by Alexandre Julliard
12 May '24
12 May '24
Module: wine Branch: master Commit: b01b5c70ea439c79c1ea22a80999d9a8cd24f434 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b01b5c70ea439c79c1ea22a80999d9…
Author: Elizabeth Figura <zfigura(a)codeweavers.com> Date: Tue Apr 30 19:21:21 2024 -0500 d3d9/tests: Clarify and expand point size tests. --- dlls/d3d9/tests/visual.c | 209 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 177 insertions(+), 32 deletions(-)
1
0
0
0
← Newer
1
...
47
48
49
50
51
52
53
...
71
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Results per page:
10
25
50
100
200