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
February 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
716 discussions
Start a n
N
ew thread
Arkadiusz Hiler : wbemprox/tests: Test LIKE queries.
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: wine Branch: master Commit: 332d48364faabaf3d2ec6aedd2be1e7bede029ad URL:
https://gitlab.winehq.org/wine/wine/-/commit/332d48364faabaf3d2ec6aedd2be1e…
Author: Arkadiusz Hiler <ahiler(a)codeweavers.com> Date: Sat Feb 3 14:45:36 2024 +0200 wbemprox/tests: Test LIKE queries. --- dlls/wbemprox/tests/query.c | 79 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index 825ad2459f5..fb173f5d6f4 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -140,6 +140,84 @@ static void test_select( IWbemServices *services ) SysFreeString( query ); } +static void check_explorer_like_query( IWbemServices *services, const WCHAR *str, BOOL expect_success, BOOL todo) +{ + HRESULT hr; + IWbemClassObject *obj[2]; + BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( str ); + LONG flags = WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY; + ULONG count; + IEnumWbemClassObject *result; + + hr = IWbemServices_ExecQuery( services, wql, query, flags, NULL, &result ); + if (hr == S_OK) + { + VARIANT var; + IEnumWbemClassObject_Next( result, 10000, 2, obj, &count ); + + todo_wine_if(todo) + ok( count == (expect_success ? 1 : 0), "expected to get %d results but got %lu\n", + (expect_success ? 1 : 0), count); + + if (count) + { + BSTR caption; + hr = IWbemClassObject_Get( obj[0], L"Caption", 0, &var, NULL, NULL ); + ok( hr == WBEM_S_NO_ERROR, "IWbemClassObject_Get failed %#lx", hr); + caption = V_BSTR(&var); + ok( !wcscmp( caption, L"explorer.exe" ), "%s is not explorer.exe\n", debugstr_w(caption)); + VariantClear( &var ); + } + + while (count--) + IWbemClassObject_Release( obj[count] ); + } + + SysFreeString( wql ); + SysFreeString( query ); +} + + +static void test_like_query( IWbemServices *services ) +{ + int i; + WCHAR query[250]; + + struct { + BOOL todo; + BOOL expect_success; + const WCHAR *str; + } queries[] = { + { FALSE, TRUE, L"explorer%" }, + { FALSE, FALSE, L"xplorer.exe" }, + { TRUE, FALSE, L"explorer.ex" }, + { FALSE, TRUE, L"%explorer%" }, + { FALSE, TRUE, L"explorer.exe%" }, + { FALSE, TRUE, L"%explorer.exe%" }, + { TRUE, TRUE, L"%plorer.exe" }, + { TRUE, TRUE, L"%plorer.exe%" }, + { TRUE, TRUE, L"__plorer.exe" }, + { TRUE, TRUE, L"e_plorer.exe" }, + { FALSE, FALSE, L"_plorer.exe" }, + { TRUE, TRUE, L"%%%plorer.e%" }, + { TRUE, TRUE, L"%plorer.e%" }, + { TRUE, TRUE, L"%plorer.e_e" }, + { TRUE, TRUE, L"%plorer.e_e" }, + { TRUE, TRUE, L"explore%exe" }, + { FALSE, FALSE, L"fancy_explore.exe" }, + { FALSE, FALSE, L"fancy%xplore%exe" }, + { FALSE, FALSE, L"%%%f%xplore%exe" }, + }; + + for (i = 0; i < ARRAYSIZE(queries); i++) + { + wsprintfW( query, L"SELECT * FROM Win32_Process WHERE Caption LIKE '%ls'", queries[i].str ); + trace("%s\n", wine_dbgstr_w(query)); + check_explorer_like_query( services, query, queries[i].expect_success, queries[i].todo ); + } +} + + static void test_associators( IWbemServices *services ) { static const WCHAR *test[] = @@ -2366,6 +2444,7 @@ START_TEST(query) test_query_async( services ); test_query_semisync( services ); test_select( services ); + test_like_query( services ); /* classes */ test_SoftwareLicensingProduct( services );
1
0
0
0
Helix Graziani : windows.globalization: Add IIterable_HSTRING impl to IVectorView_HSTRING.
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: wine Branch: master Commit: 4efbcae5e85fef67380f5970df37d5c06d3ab050 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4efbcae5e85fef67380f5970df37d5…
Author: Helix Graziani <helix.graziani(a)hotmail.com> Date: Sun Jan 28 20:22:53 2024 -0500 windows.globalization: Add IIterable_HSTRING impl to IVectorView_HSTRING. --- dlls/windows.globalization/main.c | 187 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) diff --git a/dlls/windows.globalization/main.c b/dlls/windows.globalization/main.c index 7f9594ccc6a..37746ae8d52 100644 --- a/dlls/windows.globalization/main.c +++ b/dlls/windows.globalization/main.c @@ -22,9 +22,145 @@ WINE_DEFAULT_DEBUG_CHANNEL(locale); +/* + * + * IIterator<HSTRING> + * + */ + +struct iterator_hstring +{ + IIterator_HSTRING IIterator_HSTRING_iface; + LONG ref; + + IVectorView_HSTRING *view; + UINT32 index; + UINT32 size; +}; + +static inline struct iterator_hstring *impl_from_IIterator_HSTRING( IIterator_HSTRING *iface ) +{ + return CONTAINING_RECORD(iface, struct iterator_hstring, IIterator_HSTRING_iface); +} + +static HRESULT WINAPI iterator_hstring_QueryInterface( IIterator_HSTRING *iface, REFIID iid, void **out ) +{ + struct iterator_hstring *impl = impl_from_IIterator_HSTRING(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IInspectable) || + IsEqualGUID(iid, &IID_IAgileObject) || + IsEqualGUID(iid, &IID_IIterator_HSTRING)) + { + IInspectable_AddRef((*out = &impl->IIterator_HSTRING_iface)); + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI iterator_hstring_AddRef( IIterator_HSTRING *iface ) +{ + struct iterator_hstring *impl = impl_from_IIterator_HSTRING(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p increasing refcount to %lu.\n", iface, ref); + return ref; +} + +static ULONG WINAPI iterator_hstring_Release( IIterator_HSTRING *iface ) +{ + struct iterator_hstring *impl = impl_from_IIterator_HSTRING(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + + TRACE("iface %p decreasing refcount to %lu.\n", iface, ref); + + if (!ref) + { + IVectorView_HSTRING_Release(impl->view); + free(impl); + } + + return ref; +} + +static HRESULT WINAPI iterator_hstring_GetIids( IIterator_HSTRING *iface, ULONG *iid_count, IID **iids ) +{ + FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids); + return E_NOTIMPL; +} + +static HRESULT WINAPI iterator_hstring_GetRuntimeClassName( IIterator_HSTRING *iface, HSTRING *class_name ) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT WINAPI iterator_hstring_GetTrustLevel( IIterator_HSTRING *iface, TrustLevel *trust_level ) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI iterator_hstring_get_Current( IIterator_HSTRING *iface, HSTRING *value ) +{ + struct iterator_hstring *impl = impl_from_IIterator_HSTRING(iface); + TRACE("iface %p, value %p.\n", iface, value); + return IVectorView_HSTRING_GetAt(impl->view, impl->index, value); +} + +static HRESULT WINAPI iterator_hstring_get_HasCurrent( IIterator_HSTRING *iface, boolean *value ) +{ + struct iterator_hstring *impl = impl_from_IIterator_HSTRING(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + *value = impl->index < impl->size; + return S_OK; +} + +static HRESULT WINAPI iterator_hstring_MoveNext( IIterator_HSTRING *iface, boolean *value ) +{ + struct iterator_hstring *impl = impl_from_IIterator_HSTRING(iface); + + TRACE("iface %p, value %p.\n", iface, value); + + if (impl->index < impl->size) impl->index++; + return IIterator_HSTRING_get_HasCurrent(iface, value); +} + +static HRESULT WINAPI iterator_hstring_GetMany( IIterator_HSTRING *iface, UINT32 items_size, + HSTRING *items, UINT *count ) +{ + struct iterator_hstring *impl = impl_from_IIterator_HSTRING(iface); + TRACE("iface %p, items_size %u, items %p, count %p.\n", iface, items_size, items, count); + return IVectorView_HSTRING_GetMany(impl->view, impl->index, items_size, items, count); +} + +static const IIterator_HSTRINGVtbl iterator_hstring_vtbl = +{ + /* IUnknown methods */ + iterator_hstring_QueryInterface, + iterator_hstring_AddRef, + iterator_hstring_Release, + /* IInspectable methods */ + iterator_hstring_GetIids, + iterator_hstring_GetRuntimeClassName, + iterator_hstring_GetTrustLevel, + /* IIterator<HSTRING> methods */ + iterator_hstring_get_Current, + iterator_hstring_get_HasCurrent, + iterator_hstring_MoveNext, + iterator_hstring_GetMany, +}; + struct hstring_vector { IVectorView_HSTRING IVectorView_HSTRING_iface; + IIterable_HSTRING IIterable_HSTRING_iface; LONG ref; ULONG count; @@ -54,6 +190,13 @@ static HRESULT STDMETHODCALLTYPE hstring_vector_QueryInterface(IVectorView_HSTRI return S_OK; } + if (IsEqualGUID(iid, &IID_IIterable_HSTRING)) + { + IUnknown_AddRef(iface); + *out = &impl->IIterable_HSTRING_iface; + return S_OK; + } + FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); *out = NULL; return E_NOINTERFACE; @@ -186,6 +329,8 @@ static const struct IVectorView_HSTRINGVtbl hstring_vector_vtbl = hstring_vector_GetMany, }; +static const struct IIterable_HSTRINGVtbl iterable_view_hstring_vtbl; + static HRESULT hstring_vector_create(HSTRING *values, SIZE_T count, IVectorView_HSTRING **out) { struct hstring_vector *impl; @@ -194,6 +339,7 @@ static HRESULT hstring_vector_create(HSTRING *values, SIZE_T count, IVectorView_ impl->ref = 1; impl->IVectorView_HSTRING_iface.lpVtbl = &hstring_vector_vtbl; + impl->IIterable_HSTRING_iface.lpVtbl = &iterable_view_hstring_vtbl; impl->count = count; memcpy(impl->values, values, count * sizeof(HSTRING)); @@ -201,6 +347,47 @@ static HRESULT hstring_vector_create(HSTRING *values, SIZE_T count, IVectorView_ return S_OK; } +/* + * + * IIterable<HSTRING> + * + */ + +DEFINE_IINSPECTABLE_(iterable_view_hstring, IIterable_HSTRING, struct hstring_vector, view_impl_from_IIterable_HSTRING, + IIterable_HSTRING_iface, &impl->IVectorView_HSTRING_iface) + +static HRESULT WINAPI iterable_view_hstring_First( IIterable_HSTRING *iface, IIterator_HSTRING **value ) +{ + struct hstring_vector *impl = view_impl_from_IIterable_HSTRING(iface); + struct iterator_hstring *iter; + + TRACE("iface %p, value %p.\n", iface, value); + + if (!(iter = calloc(1, sizeof(*iter)))) return E_OUTOFMEMORY; + iter->IIterator_HSTRING_iface.lpVtbl = &iterator_hstring_vtbl; + iter->ref = 1; + + IVectorView_HSTRING_AddRef((iter->view = &impl->IVectorView_HSTRING_iface)); + iter->size = impl->count; + + *value = &iter->IIterator_HSTRING_iface; + return S_OK; +} + +static const struct IIterable_HSTRINGVtbl iterable_view_hstring_vtbl = +{ + /* IUnknown methods */ + iterable_view_hstring_QueryInterface, + iterable_view_hstring_AddRef, + iterable_view_hstring_Release, + /* IInspectable methods */ + iterable_view_hstring_GetIids, + iterable_view_hstring_GetRuntimeClassName, + iterable_view_hstring_GetTrustLevel, + /* IIterable<HSTRING> methods */ + iterable_view_hstring_First, +}; + struct windows_globalization { IActivationFactory IActivationFactory_iface;
1
0
0
0
Louis Lenders : wbemprox: Add property 'Caption' to Win32_DiskDrive.
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: wine Branch: master Commit: 0edcc9b1d6981682f91724a0a71b2b32195e1b2f URL:
https://gitlab.winehq.org/wine/wine/-/commit/0edcc9b1d6981682f91724a0a71b2b…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Wed Feb 7 08:01:34 2024 +0100 wbemprox: Add property 'Caption' to Win32_DiskDrive. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=56291
--- dlls/wbemprox/builtin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 11bb2623f0d..1095450e053 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -134,6 +134,7 @@ static const struct column col_directory[] = }; static const struct column col_diskdrive[] = { + { L"Caption", CIM_STRING }, { L"DeviceId", CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, { L"Index", CIM_UINT32 }, { L"InterfaceType", CIM_STRING }, @@ -589,6 +590,7 @@ struct record_directory }; struct record_diskdrive { + const WCHAR *caption; const WCHAR *device_id; UINT32 index; const WCHAR *interfacetype; @@ -2344,6 +2346,7 @@ static enum fill_status fill_diskdrive( struct table *table, const struct expr * if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED; rec = (struct record_diskdrive *)(table->data + offset); + rec->caption = L"Wine Disk Drive"; swprintf( device_id, ARRAY_SIZE( device_id ), fmtW, index ); rec->device_id = wcsdup( device_id ); rec->index = index++;
1
0
0
0
Eric Pouech : dmime: Use sent duration in loop's playback.
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: wine Branch: master Commit: 36d6fe591b795f77fdcc34837a640da2f8c49ef7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/36d6fe591b795f77fdcc34837a640d…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Tue Jan 30 17:16:15 2024 +0100 dmime: Use sent duration in loop's playback. When playing a loop, and if no end of loop point has been defined (meaning = play whole segment), don't rely on segment's length for wave tracks as their length is always 1. Compute segment length in this case by grabbing each track's playback length in segment state's internal graph. This feature is only activated for messages generated by wave tracks, but could be extended if needed to other types of messages. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/dmime/segmentstate.c | 37 ++++++++++++++++++++++++++++++++++++- dlls/dmime/tests/dmime.c | 22 +++++++++++++++------- dlls/dmime/wavetrack.c | 6 +++--- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c index 0deb396d384..4fece4181e1 100644 --- a/dlls/dmime/segmentstate.c +++ b/dlls/dmime/segmentstate.c @@ -54,6 +54,10 @@ struct segment_state MUSIC_TIME start_point; MUSIC_TIME end_point; MUSIC_TIME played; + + REFERENCE_TIME actual_duration; + MUSIC_TIME actual_end_point; + BOOL auto_download; DWORD repeats, actual_repeats; DWORD track_flags; @@ -227,12 +231,29 @@ static ULONG WINAPI segment_state_graph_Release(IDirectMusicGraph *iface) static HRESULT WINAPI segment_state_graph_StampPMsg(IDirectMusicGraph *iface, DMUS_PMSG *msg) { struct segment_state *This = impl_from_IDirectMusicGraph(iface); + HRESULT hr; TRACE("(%p, %p)\n", This, msg); if (!msg) return E_POINTER; - return IDirectMusicGraph_StampPMsg(This->parent_graph, msg); + hr = IDirectMusicGraph_StampPMsg(This->parent_graph, msg); + if (SUCCEEDED(hr)) + { + switch (msg->dwType) + { + case DMUS_PMSGT_WAVE: + if (msg->dwFlags & (DMUS_PMSGF_REFTIME | DMUS_PMSGF_MUSICTIME)) + { + if (((DMUS_WAVE_PMSG *)msg)->rtDuration > This->actual_duration) + This->actual_duration = ((DMUS_WAVE_PMSG *)msg)->rtDuration; + } + break; + default: ; + } + } + + return hr; } static HRESULT WINAPI segment_state_graph_InsertTool(IDirectMusicGraph *iface, IDirectMusicTool *tool, @@ -373,6 +394,9 @@ static HRESULT segment_state_play_until(struct segment_state *This, IDirectMusic played = min(end_time - This->start_time, This->end_point - This->start_point); + if (This->track_flags & DMUS_TRACKF_DIRTY) + This->actual_duration = 0; + LIST_FOR_EACH_ENTRY(entry, &This->tracks, struct track_entry, entry) { if (FAILED(hr = IDirectMusicTrack_Play(entry->track, entry->state_data, @@ -424,6 +448,17 @@ static HRESULT segment_state_play_chunk(struct segment_state *This, IDirectMusic if (FAILED(hr = IDirectMusicSegment_GetLoopPoints(This->segment, &This->played, &This->end_point))) break; + if (!This->played && !This->end_point) + { + if (!This->actual_end_point && This->actual_duration) + { + IDirectMusicPerformance_ReferenceToMusicTime(performance, time + This->actual_duration, &This->actual_end_point); + This->actual_end_point -= This->start_time + This->played; + } + This->end_point = This->actual_end_point; + if (next_time < This->start_time + This->end_point) + next_time += This->end_point - This->start_point; + } This->start_time += This->end_point - This->start_point; This->actual_repeats--; This->track_flags |= DMUS_TRACKF_LOOP | DMUS_TRACKF_SEEK; diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 8ae62b38670..218dc01045d 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -3660,11 +3660,21 @@ static void test_wave_pmsg(unsigned num_repeats) for (i = 0; i <= num_repeats; i++) { - ret = test_tool_wait_message(tool, 500, (DMUS_PMSG **)&wave); - todo_wine_if(num_repeats && ret) - ok(!ret, "got %#lx\n", ret); - if (ret) continue; - ok(wave->dwType == DMUS_PMSGT_WAVE, "got %p\n", wave); + /* Both native and builtin dmime queue messages for a given amount of time, + * then wait for these messages to be processed before queuing additional messages. + * However, Wine "wait" time is way smaller than native, and is hit before the 10 + * reiterations in loop here. + * And moreover, Wine uses internal messages for this "wait" operation. + * Discard Wine's internal messages to be on par with native. + */ + do + { + ret = test_tool_wait_message(tool, 2000, (DMUS_PMSG **)&wave); + ok(!ret, "got %#lx\n", ret); + } while (num_repeats && !ret && (wave->dwType >= 0x10 || wave->dwType == DMUS_PMSGT_DIRTY)); + if (ret) break; + + ok(wave->dwType == DMUS_PMSGT_WAVE, "got %p %lu\n", wave, wave->dwType); ok(wave->dwSize == sizeof(*wave), "got %lu\n", wave->dwSize); ok(!!wave->punkUser, "got %p\n", wave->punkUser); ok((wave->dwFlags & DMUS_PMSGF_REFTIME) && (wave->dwFlags & DMUS_PMSGF_MUSICTIME), @@ -3672,7 +3682,6 @@ static void test_wave_pmsg(unsigned num_repeats) if (i == 0) mt_start_ref = wave->mtTime; else - todo_wine ok(wave->mtTime == mt_start_ref + length * i, "got %lu (%lu,%lu)\n", wave->mtTime, mt_start_ref, i * length); ok(wave->rtStartOffset == 0, "got %I64d\n", wave->rtStartOffset); ok(wave->rtDuration == 1000000, "got %I64d\n", wave->rtDuration); @@ -3685,7 +3694,6 @@ static void test_wave_pmsg(unsigned num_repeats) } ret = test_tool_wait_message(tool, 500, &msg); - todo_wine_if(num_repeats) ok(!ret, "got %#lx\n", ret); if (!ret) { diff --git a/dlls/dmime/wavetrack.c b/dlls/dmime/wavetrack.c index 3d64e6e84c5..64480c6422f 100644 --- a/dlls/dmime/wavetrack.c +++ b/dlls/dmime/wavetrack.c @@ -160,11 +160,11 @@ static HRESULT WINAPI wave_track_Play(IDirectMusicTrack8 *iface, void *state_dat if (track_flags & ~handled_track_flags) FIXME("track_flags %#lx not implemented\n", track_flags & ~handled_track_flags); - if (segment_state) FIXME("segment_state %p not implemented\n", segment_state); - if (!(track_flags & (DMUS_TRACKF_START | DMUS_TRACKF_LOOP))) return S_OK; - if (FAILED(hr = IDirectMusicPerformance_QueryInterface(performance, + if (FAILED(hr = IDirectMusicSegmentState_QueryInterface(segment_state, + &IID_IDirectMusicGraph, (void **)&graph)) && + FAILED(hr = IDirectMusicPerformance_QueryInterface(performance, &IID_IDirectMusicGraph, (void **)&graph))) return hr;
1
0
0
0
Eric Pouech : dmime: Generate track flags while in loop.
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: wine Branch: master Commit: ef2830b62033a0feb66471ce83f88cb9f5602370 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ef2830b62033a0feb66471ce83f88c…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Tue Jan 30 15:41:12 2024 +0100 dmime: Generate track flags while in loop. Store track_flags inside segment state so that they can be reused in subsequent calls. The start/seek/loop flags are now properly set when calling IDirectMusicTrack_Play(). Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/dmime/segmentstate.c | 13 ++++++++----- dlls/dmime/wavetrack.c | 7 +++++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c index 51067d21d3d..0deb396d384 100644 --- a/dlls/dmime/segmentstate.c +++ b/dlls/dmime/segmentstate.c @@ -56,6 +56,7 @@ struct segment_state MUSIC_TIME played; BOOL auto_download; DWORD repeats, actual_repeats; + DWORD track_flags; struct list tracks; }; @@ -385,12 +386,13 @@ static HRESULT segment_state_play_until(struct segment_state *This, IDirectMusic } This->played = played; + This->track_flags &= ~(DMUS_TRACKF_START|DMUS_TRACKF_DIRTY); if (This->start_point + This->played >= This->end_point) return S_FALSE; return S_OK; } static HRESULT segment_state_play_chunk(struct segment_state *This, IDirectMusicPerformance8 *performance, - REFERENCE_TIME duration, DWORD track_flags) + REFERENCE_TIME duration) { IDirectMusicSegmentState *iface = (IDirectMusicSegmentState *)&This->IDirectMusicSegmentState8_iface; MUSIC_TIME next_time; @@ -404,7 +406,7 @@ static HRESULT segment_state_play_chunk(struct segment_state *This, IDirectMusic time + duration, &next_time))) return hr; - while ((hr = segment_state_play_until(This, performance, next_time, track_flags)) == S_FALSE) + while ((hr = segment_state_play_until(This, performance, next_time, This->track_flags)) == S_FALSE) { if (!This->actual_repeats) { @@ -424,6 +426,7 @@ static HRESULT segment_state_play_chunk(struct segment_state *This, IDirectMusic break; This->start_time += This->end_point - This->start_point; This->actual_repeats--; + This->track_flags |= DMUS_TRACKF_LOOP | DMUS_TRACKF_SEEK; if (next_time <= This->start_time || This->end_point <= This->start_point) break; } @@ -444,8 +447,8 @@ HRESULT segment_state_play(IDirectMusicSegmentState *iface, IDirectMusicPerforma return hr; } - if (FAILED(hr = segment_state_play_chunk(This, performance, 10000000, - DMUS_TRACKF_START | DMUS_TRACKF_SEEK | DMUS_TRACKF_DIRTY))) + This->track_flags = DMUS_TRACKF_START | DMUS_TRACKF_SEEK | DMUS_TRACKF_DIRTY; + if (FAILED(hr = segment_state_play_chunk(This, performance, 10000000))) return hr; if (hr == S_FALSE) return S_OK; @@ -458,7 +461,7 @@ HRESULT segment_state_tick(IDirectMusicSegmentState *iface, IDirectMusicPerforma TRACE("%p %p\n", iface, performance); - return segment_state_play_chunk(This, performance, 10000000, 0); + return segment_state_play_chunk(This, performance, 10000000); } HRESULT segment_state_stop(IDirectMusicSegmentState *iface, IDirectMusicPerformance8 *performance) diff --git a/dlls/dmime/wavetrack.c b/dlls/dmime/wavetrack.c index 7f2fe4a8e5f..3d64e6e84c5 100644 --- a/dlls/dmime/wavetrack.c +++ b/dlls/dmime/wavetrack.c @@ -147,6 +147,7 @@ static HRESULT WINAPI wave_track_Play(IDirectMusicTrack8 *iface, void *state_dat MUSIC_TIME start_time, MUSIC_TIME end_time, MUSIC_TIME time_offset, DWORD track_flags, IDirectMusicPerformance *performance, IDirectMusicSegmentState *segment_state, DWORD track_id) { + static const DWORD handled_track_flags = DMUS_TRACKF_START | DMUS_TRACKF_SEEK | DMUS_TRACKF_DIRTY | DMUS_TRACKF_LOOP; struct wave_track *This = impl_from_IDirectMusicTrack8(iface); LONG volume = This->header.lVolume; IDirectMusicGraph *graph; @@ -157,9 +158,11 @@ static HRESULT WINAPI wave_track_Play(IDirectMusicTrack8 *iface, void *state_dat TRACE("(%p, %p, %ld, %ld, %ld, %#lx, %p, %p, %ld)\n", This, state_data, start_time, end_time, time_offset, track_flags, performance, segment_state, track_id); - if (track_flags) FIXME("track_flags %#lx not implemented\n", track_flags); + if (track_flags & ~handled_track_flags) + FIXME("track_flags %#lx not implemented\n", track_flags & ~handled_track_flags); if (segment_state) FIXME("segment_state %p not implemented\n", segment_state); - if (!(track_flags & DMUS_TRACKF_START)) return S_OK; + + if (!(track_flags & (DMUS_TRACKF_START | DMUS_TRACKF_LOOP))) return S_OK; if (FAILED(hr = IDirectMusicPerformance_QueryInterface(performance, &IID_IDirectMusicGraph, (void **)&graph)))
1
0
0
0
Eric Pouech : dmime: Add IDirectMusicGraph interface to segment state.
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: wine Branch: master Commit: dfaa45069eac29445e2282cccb1cb4db7dd7b238 URL:
https://gitlab.winehq.org/wine/wine/-/commit/dfaa45069eac29445e2282cccb1cb4…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Mon Jan 29 13:45:19 2024 +0100 dmime: Add IDirectMusicGraph interface to segment state. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/dmime/segmentstate.c | 97 +++++++++++++++++++++++++++++++++++++++++++++-- dlls/dmime/tests/dmime.c | 1 - 2 files changed, 93 insertions(+), 5 deletions(-) diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c index 38ff9185534..51067d21d3d 100644 --- a/dlls/dmime/segmentstate.c +++ b/dlls/dmime/segmentstate.c @@ -45,8 +45,10 @@ static void track_entry_destroy(struct track_entry *entry) struct segment_state { IDirectMusicSegmentState8 IDirectMusicSegmentState8_iface; + IDirectMusicGraph IDirectMusicGraph_iface; LONG ref; + IDirectMusicGraph *parent_graph; IDirectMusicSegment *segment; MUSIC_TIME start_time; MUSIC_TIME start_point; @@ -82,7 +84,12 @@ static HRESULT WINAPI segment_state_QueryInterface(IDirectMusicSegmentState8 *if *ppobj = &This->IDirectMusicSegmentState8_iface; return S_OK; } - + if (IsEqualIID(riid, &IID_IDirectMusicGraph)) + { + IDirectMusicSegmentState8_AddRef(iface); + *ppobj = &This->IDirectMusicGraph_iface; + return S_OK; + } WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj); return E_NOINTERFACE; } @@ -108,6 +115,7 @@ static ULONG WINAPI segment_state_Release(IDirectMusicSegmentState8 *iface) { segment_state_end_play((IDirectMusicSegmentState *)iface, NULL); if (This->segment) IDirectMusicSegment_Release(This->segment); + if (This->parent_graph) IDirectMusicGraph_Release(This->parent_graph); free(This); } @@ -192,6 +200,73 @@ static const IDirectMusicSegmentState8Vtbl segment_state_vtbl = segment_state_GetObjectInPath, }; +static inline struct segment_state *impl_from_IDirectMusicGraph(IDirectMusicGraph *iface) +{ + return CONTAINING_RECORD(iface, struct segment_state, IDirectMusicGraph_iface); +} + +static HRESULT WINAPI segment_state_graph_QueryInterface(IDirectMusicGraph *iface, REFIID riid, void **ret_iface) +{ + struct segment_state *This = impl_from_IDirectMusicGraph(iface); + return IDirectMusicSegmentState8_QueryInterface(&This->IDirectMusicSegmentState8_iface, riid, ret_iface); +} + +static ULONG WINAPI segment_state_graph_AddRef(IDirectMusicGraph *iface) +{ + struct segment_state *This = impl_from_IDirectMusicGraph(iface); + return IDirectMusicSegmentState8_AddRef(&This->IDirectMusicSegmentState8_iface); +} + +static ULONG WINAPI segment_state_graph_Release(IDirectMusicGraph *iface) +{ + struct segment_state *This = impl_from_IDirectMusicGraph(iface); + return IDirectMusicSegmentState8_Release(&This->IDirectMusicSegmentState8_iface); +} + +static HRESULT WINAPI segment_state_graph_StampPMsg(IDirectMusicGraph *iface, DMUS_PMSG *msg) +{ + struct segment_state *This = impl_from_IDirectMusicGraph(iface); + + TRACE("(%p, %p)\n", This, msg); + + if (!msg) return E_POINTER; + + return IDirectMusicGraph_StampPMsg(This->parent_graph, msg); +} + +static HRESULT WINAPI segment_state_graph_InsertTool(IDirectMusicGraph *iface, IDirectMusicTool *tool, + DWORD *channels, DWORD channels_count, LONG index) +{ + struct segment_state *This = impl_from_IDirectMusicGraph(iface); + TRACE("(%p, %p, %p, %lu, %ld)\n", This, tool, channels, channels_count, index); + return E_NOTIMPL; +} + +static HRESULT WINAPI segment_state_graph_GetTool(IDirectMusicGraph *iface, DWORD index, IDirectMusicTool **tool) +{ + struct segment_state *This = impl_from_IDirectMusicGraph(iface); + TRACE("(%p, %lu, %p)\n", This, index, tool); + return E_NOTIMPL; +} + +static HRESULT WINAPI segment_state_graph_RemoveTool(IDirectMusicGraph *iface, IDirectMusicTool *tool) +{ + struct segment_state *This = impl_from_IDirectMusicGraph(iface); + TRACE("(%p, %p)\n", This, tool); + return E_NOTIMPL; +} + +static const IDirectMusicGraphVtbl segment_state_graph_vtbl = +{ + segment_state_graph_QueryInterface, + segment_state_graph_AddRef, + segment_state_graph_Release, + segment_state_graph_StampPMsg, + segment_state_graph_InsertTool, + segment_state_graph_GetTool, + segment_state_graph_RemoveTool, +}; + /* for ClassFactory */ HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface) { @@ -201,6 +276,7 @@ HRESULT create_dmsegmentstate(REFIID riid, void **ret_iface) *ret_iface = NULL; if (!(obj = calloc(1, sizeof(*obj)))) return E_OUTOFMEMORY; obj->IDirectMusicSegmentState8_iface.lpVtbl = &segment_state_vtbl; + obj->IDirectMusicGraph_iface.lpVtbl = &segment_state_graph_vtbl; obj->ref = 1; obj->start_time = -1; list_init(&obj->tracks); @@ -216,6 +292,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time { IDirectMusicSegmentState *iface; struct segment_state *This; + IDirectMusicGraph *graph; IDirectMusicTrack *track; HRESULT hr; UINT i; @@ -228,7 +305,10 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time This->segment = segment; IDirectMusicSegment_AddRef(This->segment); - if (SUCCEEDED(hr = IDirectMusicPerformance8_GetGlobalParam(performance, &GUID_PerfAutoDownload, + hr = IDirectMusicPerformance8_QueryInterface(performance, &IID_IDirectMusicGraph, (void **)&graph); + + if (SUCCEEDED(hr) && + SUCCEEDED(hr = IDirectMusicPerformance8_GetGlobalParam(performance, &GUID_PerfAutoDownload, &This->auto_download, sizeof(This->auto_download))) && This->auto_download) hr = IDirectMusicSegment_SetParam(segment, &GUID_DownloadToAudioPath, -1, DMUS_SEG_ALLTRACKS, 0, performance); @@ -268,8 +348,17 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time } } - if (SUCCEEDED(hr)) *ret_iface = iface; - else IDirectMusicSegmentState_Release(iface); + if (SUCCEEDED(hr)) + { + *ret_iface = iface; + This->parent_graph = graph; + } + else + { + IDirectMusicSegmentState_Release(iface); + IDirectMusicGraph_Release(graph); + } + return hr; } diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index cb4a58d4403..8ae62b38670 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -4577,7 +4577,6 @@ static void test_segment_state(void) graph = (void *)0xdeadbeef; hr = IDirectMusicSegmentState_QueryInterface(state, &IID_IDirectMusicGraph, (void **)&graph); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); if (hr == S_OK) {
1
0
0
0
Eric Pouech : dmime: Add tests about segment state's graph interface.
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: wine Branch: master Commit: 425c270d27e0375a7a213b1fdfa17d527194c96b URL:
https://gitlab.winehq.org/wine/wine/-/commit/425c270d27e0375a7a213b1fdfa17d…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Mon Jan 29 10:44:53 2024 +0100 dmime: Add tests about segment state's graph interface. Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/dmime/tests/dmime.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index f6f34915547..cb4a58d4403 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -4575,6 +4575,20 @@ static void test_segment_state(void) ok(state != tmp_state, "got %p\n", state); IDirectMusicSegmentState_Release(tmp_state); + graph = (void *)0xdeadbeef; + hr = IDirectMusicSegmentState_QueryInterface(state, &IID_IDirectMusicGraph, (void **)&graph); + todo_wine + ok(hr == S_OK, "got %#lx\n", hr); + if (hr == S_OK) + { + IDirectMusicTool *segment_state_tool; + + hr = IDirectMusicGraph_GetTool(graph, 0, &segment_state_tool); + ok(hr == E_NOTIMPL, "got %#lx\n", hr); + if (SUCCEEDED(hr)) IDirectMusicTool_Release(segment_state_tool); + IDirectMusicGraph_Release(graph); + } + tmp_state = (void *)0xdeadbeef; hr = IDirectMusicPerformance_GetSegmentState(performance, &tmp_state, 0); ok(hr == S_OK || broken(hr == DMUS_E_NOT_FOUND) /* sometimes on Windows */, "got %#lx\n", hr);
1
0
0
0
Eric Pouech : dmime: Fully implement IDirectMusicSegmentState::GetRepeats().
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: wine Branch: master Commit: ed92095f28808282c5338a5cb89ec758f7b3b4e5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ed92095f28808282c5338a5cb89ec7…
Author: Eric Pouech <epouech(a)codeweavers.com> Date: Mon Jan 22 17:57:08 2024 +0100 dmime: Fully implement IDirectMusicSegmentState::GetRepeats(). Signed-off-by: Eric Pouech <epouech(a)codeweavers.com> --- dlls/dmime/segmentstate.c | 10 ++++++---- dlls/dmime/tests/dmime.c | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dlls/dmime/segmentstate.c b/dlls/dmime/segmentstate.c index 3b939bc95ca..38ff9185534 100644 --- a/dlls/dmime/segmentstate.c +++ b/dlls/dmime/segmentstate.c @@ -53,7 +53,7 @@ struct segment_state MUSIC_TIME end_point; MUSIC_TIME played; BOOL auto_download; - DWORD repeats; + DWORD repeats, actual_repeats; struct list tracks; }; @@ -117,7 +117,8 @@ static ULONG WINAPI segment_state_Release(IDirectMusicSegmentState8 *iface) static HRESULT WINAPI segment_state_GetRepeats(IDirectMusicSegmentState8 *iface, DWORD *repeats) { struct segment_state *This = impl_from_IDirectMusicSegmentState8(iface); - FIXME("(%p, %p): semi-stub\n", This, repeats); + TRACE("(%p, %p)\n", This, repeats); + *repeats = This->repeats; return S_OK; } @@ -236,6 +237,7 @@ HRESULT segment_state_create(IDirectMusicSegment *segment, MUSIC_TIME start_time if (SUCCEEDED(hr)) hr = IDirectMusicSegment_GetStartPoint(segment, &This->start_point); if (SUCCEEDED(hr)) hr = IDirectMusicSegment_GetLength(segment, &This->end_point); if (SUCCEEDED(hr)) hr = IDirectMusicSegment_GetRepeats(segment, &This->repeats); + if (SUCCEEDED(hr)) This->actual_repeats = This->repeats; for (i = 0; SUCCEEDED(hr); i++) { @@ -315,7 +317,7 @@ static HRESULT segment_state_play_chunk(struct segment_state *This, IDirectMusic while ((hr = segment_state_play_until(This, performance, next_time, track_flags)) == S_FALSE) { - if (!This->repeats) + if (!This->actual_repeats) { MUSIC_TIME end_time = This->start_time + This->played; @@ -332,7 +334,7 @@ static HRESULT segment_state_play_chunk(struct segment_state *This, IDirectMusic &This->end_point))) break; This->start_time += This->end_point - This->start_point; - This->repeats--; + This->actual_repeats--; if (next_time <= This->start_time || This->end_point <= This->start_point) break; } diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 26fdf3ef2a5..f6f34915547 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -4540,7 +4540,6 @@ static void test_segment_state(void) value = 0xdeadbeef; hr = IDirectMusicSegmentState_GetRepeats(state, &value); ok(hr == S_OK, "got %#lx\n", hr); - todo_wine ok(value == 0, "got %#lx\n", value); time = 0xdeadbeef; hr = IDirectMusicSegmentState_GetStartTime(state, &time); @@ -4624,7 +4623,6 @@ static void test_segment_state(void) value = 0xdeadbeef; hr = IDirectMusicSegmentState_GetRepeats(state, &value); ok(hr == S_OK, "got %#lx\n", hr); - todo_wine ok(value == 0, "got %#lx\n", value); time = 0xdeadbeef; hr = IDirectMusicSegmentState_GetStartTime(state, &time); @@ -4655,7 +4653,6 @@ static void test_segment_state(void) value = 0xdeadbeef; hr = IDirectMusicSegmentState_GetRepeats(state, &value); ok(hr == S_OK, "got %#lx\n", hr); - todo_wine ok(value == 0, "got %#lx\n", value); time = 0xdeadbeef; hr = IDirectMusicSegmentState_GetStartTime(state, &time);
1
0
0
0
Conor McCarthy : vkd3d-shader/dxil: Support forward-referenced value ids.
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: vkd3d Branch: master Commit: efddcc9a99e671f3553c34b28a2c3ec5b76f6166 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/efddcc9a99e671f3553c34b28a2c3…
Author: Conor McCarthy <cmccarthy(a)codeweavers.com> Date: Fri Oct 13 00:18:50 2023 +1000 vkd3d-shader/dxil: Support forward-referenced value ids. --- libs/vkd3d-shader/dxil.c | 82 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index e718ed84..bd165146 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -2179,21 +2179,29 @@ static enum vkd3d_data_type vkd3d_data_type_from_sm6_type(const struct sm6_type } static void register_init_ssa_vector(struct vkd3d_shader_register *reg, const struct sm6_type *type, - unsigned int component_count, struct sm6_parser *sm6) + unsigned int component_count, struct sm6_value *value, struct sm6_parser *sm6) { enum vkd3d_data_type data_type; unsigned int id; - id = sm6_parser_alloc_ssa_id(sm6); + if (value && register_is_ssa(&value->u.reg) && value->u.reg.idx[0].offset) + { + id = value->u.reg.idx[0].offset; + TRACE("Using forward-allocated id %u.\n", id); + } + else + { + id = sm6_parser_alloc_ssa_id(sm6); + } data_type = vkd3d_data_type_from_sm6_type(sm6_type_get_scalar_type(type, 0)); register_init_with_id(reg, VKD3DSPR_SSA, data_type, id); reg->dimension = component_count > 1 ? VSIR_DIMENSION_VEC4 : VSIR_DIMENSION_SCALAR; } static void register_init_ssa_scalar(struct vkd3d_shader_register *reg, const struct sm6_type *type, - struct sm6_parser *sm6) + struct sm6_value *value, struct sm6_parser *sm6) { - register_init_ssa_vector(reg, type, 1, sm6); + register_init_ssa_vector(reg, sm6_type_get_scalar_type(type, 0), 1, value, sm6); } static void dst_param_init(struct vkd3d_shader_dst_param *param) @@ -2218,10 +2226,10 @@ static void dst_param_init_vector(struct vkd3d_shader_dst_param *param, unsigned } static void dst_param_init_ssa_scalar(struct vkd3d_shader_dst_param *param, const struct sm6_type *type, - struct sm6_parser *sm6) + struct sm6_value *value, struct sm6_parser *sm6) { dst_param_init(param); - register_init_ssa_scalar(¶m->reg, type, sm6); + register_init_ssa_scalar(¶m->reg, type, value, sm6); } static inline void src_param_init(struct vkd3d_shader_src_param *param) @@ -2278,7 +2286,7 @@ static void instruction_dst_param_init_ssa_scalar(struct vkd3d_shader_instructio struct vkd3d_shader_dst_param *param = instruction_dst_params_alloc(ins, 1, sm6); struct sm6_value *dst = sm6_parser_get_current_value(sm6); - dst_param_init_ssa_scalar(param, dst->type, sm6); + dst_param_init_ssa_scalar(param, dst->type, dst, sm6); param->write_mask = VKD3DSP_WRITEMASK_0; dst->u.reg = param->reg; } @@ -2290,7 +2298,7 @@ static void instruction_dst_param_init_ssa_vector(struct vkd3d_shader_instructio struct sm6_value *dst = sm6_parser_get_current_value(sm6); dst_param_init_vector(param, component_count); - register_init_ssa_vector(¶m->reg, sm6_type_get_scalar_type(dst->type, 0), component_count, sm6); + register_init_ssa_vector(¶m->reg, sm6_type_get_scalar_type(dst->type, 0), component_count, dst, sm6); dst->u.reg = param->reg; } @@ -2453,6 +2461,7 @@ static const struct sm6_value *sm6_parser_get_value_safe(struct sm6_parser *sm6, static size_t sm6_parser_get_value_idx_by_ref(struct sm6_parser *sm6, const struct dxil_record *record, const struct sm6_type *fwd_type, unsigned int *rec_idx) { + struct sm6_value *value; unsigned int idx; uint64_t val_ref; size_t operand; @@ -2466,23 +2475,39 @@ static size_t sm6_parser_get_value_idx_by_ref(struct sm6_parser *sm6, const stru if (operand == SIZE_MAX) return SIZE_MAX; - if (operand >= sm6->value_count) + if (operand >= sm6->value_count && !fwd_type) + { + /* Forward references are followed by a type id unless an earlier operand set the type, + * or it is contained in a function declaration. */ + if (!dxil_record_validate_operand_min_count(record, idx + 1, sm6)) + return SIZE_MAX; + if (!(fwd_type = sm6_parser_get_type(sm6, record->operands[idx++]))) + return SIZE_MAX; + } + *rec_idx = idx; + + if (fwd_type) { - if (!fwd_type) + value = &sm6->values[operand]; + if (value->type) { - /* Forward references are followed by a type id unless an earlier operand set the type, - * or it is contained in a function declaration. */ - if (!dxil_record_validate_operand_min_count(record, idx + 1, sm6)) - return SIZE_MAX; - if (!(fwd_type = sm6_parser_get_type(sm6, record->operands[idx++]))) - return SIZE_MAX; + if (value->type != fwd_type) + { + WARN("Value already has a mismatching type.\n"); + vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_TYPE_MISMATCH, + "The type of a source value does not match the predefined type."); + } + } + else + { + value->type = fwd_type; + value->value_type = VALUE_TYPE_REG; + register_init_with_id(&value->u.reg, VKD3DSPR_SSA, vkd3d_data_type_from_sm6_type( + sm6_type_get_scalar_type(fwd_type, 0)), sm6_parser_alloc_ssa_id(sm6)); + value->u.reg.dimension = sm6_type_is_scalar(fwd_type) ? VSIR_DIMENSION_SCALAR + : VSIR_DIMENSION_VEC4; } - FIXME("Forward value references are not supported yet.\n"); - vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND, - "Unsupported value forward reference."); - return SIZE_MAX; } - *rec_idx = idx; return operand; } @@ -3479,7 +3504,7 @@ static void sm6_parser_emit_binop(struct sm6_parser *sm6, const struct dxil_reco dst_param_init(&dst_params[0]); dst_param_init(&dst_params[1]); - register_init_ssa_scalar(&dst_params[index].reg, a->type, sm6); + register_init_ssa_scalar(&dst_params[index].reg, a->type, dst, sm6); vsir_register_init(&dst_params[index ^ 1].reg, VKD3DSPR_NULL, VKD3D_DATA_UNUSED, 0); dst->u.reg = dst_params[index].reg; } @@ -3992,7 +4017,7 @@ static void sm6_parser_emit_dx_sincos(struct sm6_parser *sm6, enum dx_intrinsic_ dst_params = instruction_dst_params_alloc(ins, 2, sm6); dst_param_init(&dst_params[0]); dst_param_init(&dst_params[1]); - register_init_ssa_scalar(&dst_params[index].reg, dst->type, sm6); + register_init_ssa_scalar(&dst_params[index].reg, dst->type, dst, sm6); vsir_register_init(&dst_params[index ^ 1].reg, VKD3DSPR_NULL, VKD3D_DATA_UNUSED, 0); dst->u.reg = dst_params[index].reg; } @@ -4931,7 +4956,7 @@ static void sm6_parser_emit_phi(struct sm6_parser *sm6, const struct dxil_record } dst->type = type; - register_init_ssa_scalar(&dst->u.reg, type, sm6); + register_init_ssa_scalar(&dst->u.reg, type, dst, sm6); if (!(phi = sm6_block_phi_require_space(code_block, sm6))) return; @@ -5504,6 +5529,7 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6, const struct vkd3d_shader_instruction *ins; size_t i, block_idx, block_count; const struct dxil_record *record; + const struct sm6_type *fwd_type; bool ret_found, is_terminator; struct sm6_block *code_block; struct sm6_value *dst; @@ -5580,6 +5606,7 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6, const ins->handler_idx = VKD3DSIH_INVALID; dst = sm6_parser_get_current_value(sm6); + fwd_type = dst->type; dst->type = NULL; dst->value_type = VALUE_TYPE_REG; is_terminator = false; @@ -5659,6 +5686,13 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6, const else assert(ins->handler_idx == VKD3DSIH_NOP); + if (dst->type && fwd_type && dst->type != fwd_type) + { + WARN("Type mismatch.\n"); + vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_TYPE_MISMATCH, + "The type of a result value does not match the type defined by a forward reference."); + } + sm6->value_count += !!dst->type; }
1
0
0
0
Alexandre Julliard : ntdll: Use the correct machine when loading ntdll on ARM64EC.
by Alexandre Julliard
07 Feb '24
07 Feb '24
Module: wine Branch: master Commit: c1295953816e6b071e6ad0e58f142a3b5f74574c URL:
https://gitlab.winehq.org/wine/wine/-/commit/c1295953816e6b071e6ad0e58f142a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Feb 7 19:07:40 2024 +0100 ntdll: Use the correct machine when loading ntdll on ARM64EC. --- dlls/ntdll/unix/loader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index 662ec5ef7a8..05284115b67 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1641,6 +1641,7 @@ static void load_ntdll(void) static WCHAR path[] = {'\\','?','?','\\','C',':','\\','w','i','n','d','o','w','s','\\', 's','y','s','t','e','m','3','2','\\','n','t','d','l','l','.','d','l','l',0}; const char *pe_dir = get_pe_dir( current_machine ); + USHORT machine = current_machine; unsigned int status; SECTION_IMAGE_INFORMATION info; OBJECT_ATTRIBUTES attr; @@ -1654,7 +1655,9 @@ static void load_ntdll(void) if (build_dir) asprintf( &name, "%s%s/ntdll.dll", ntdll_dir, pe_dir ); else asprintf( &name, "%s%s/ntdll.dll", dll_dir, pe_dir ); - status = open_builtin_pe_file( name, &attr, &module, &size, &info, 0, 0, current_machine, FALSE ); + + if (is_arm64ec()) machine = main_image_info.Machine; + status = open_builtin_pe_file( name, &attr, &module, &size, &info, 0, 0, machine, FALSE ); if (status == STATUS_DLL_NOT_FOUND) { free( name );
1
0
0
0
← Newer
1
...
55
56
57
58
59
60
61
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200