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
September 2023
----- 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
920 discussions
Start a n
N
ew thread
Rémi Bernon : dmusic: Implement instrument articulation downloads.
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: 5626be6bb8b22d6fd476ad8c5f7e236f5d1b4ff2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5626be6bb8b22d6fd476ad8c5f7e23…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Sep 9 14:06:32 2023 +0200 dmusic: Implement instrument articulation downloads. --- dlls/dmusic/instrument.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c index a15a8d4e84f..8ce3c0bc979 100644 --- a/dlls/dmusic/instrument.c +++ b/dlls/dmusic/instrument.c @@ -452,6 +452,39 @@ HRESULT instrument_create_from_chunk(IStream *stream, struct chunk_entry *parent return S_OK; } +static void write_articulation_download(struct list *articulations, ULONG *offsets, + BYTE **ptr, UINT index, DWORD *first, UINT *end) +{ + DMUS_ARTICULATION2 *dmus_articulation2 = NULL; + struct articulation *articulation; + CONNECTIONLIST *list; + UINT size; + + LIST_FOR_EACH_ENTRY(articulation, articulations, struct articulation, entry) + { + if (dmus_articulation2) dmus_articulation2->ulNextArtIdx = index; + else *first = index; + + offsets[index++] = sizeof(DMUS_DOWNLOADINFO) + *ptr - (BYTE *)offsets; + dmus_articulation2 = (DMUS_ARTICULATION2 *)*ptr; + (*ptr) += sizeof(DMUS_ARTICULATION2); + + dmus_articulation2->ulArtIdx = index; + dmus_articulation2->ulFirstExtCkIdx = 0; + dmus_articulation2->ulNextArtIdx = 0; + + size = articulation->list.cConnections * sizeof(CONNECTION); + offsets[index++] = sizeof(DMUS_DOWNLOADINFO) + *ptr - (BYTE *)offsets; + list = (CONNECTIONLIST *)*ptr; + (*ptr) += sizeof(CONNECTIONLIST) + size; + + *list = articulation->list; + memcpy(list + 1, articulation->connections, size); + } + + *end = index; +} + struct download_buffer { DMUS_DOWNLOADINFO info; @@ -464,6 +497,7 @@ HRESULT instrument_download_to_port(IDirectMusicInstrument *iface, IDirectMusicP IDirectMusicDownloadedInstrument **downloaded) { struct instrument *This = impl_from_IDirectMusicInstrument(iface); + struct articulation *articulation; struct download_buffer *buffer; IDirectMusicDownload *download; DWORD size, offset_count; @@ -477,10 +511,26 @@ HRESULT instrument_download_to_port(IDirectMusicInstrument *iface, IDirectMusicP size += sizeof(ULONG) + sizeof(DMUS_INSTRUMENT); offset_count = 1; + LIST_FOR_EACH_ENTRY(articulation, &This->articulations, struct articulation, entry) + { + size += sizeof(ULONG) + sizeof(DMUS_ARTICULATION2); + size += sizeof(ULONG) + sizeof(CONNECTIONLIST); + size += articulation->list.cConnections * sizeof(CONNECTION); + offset_count += 2; + } + LIST_FOR_EACH_ENTRY(region, &This->regions, struct region, entry) { size += sizeof(ULONG) + sizeof(DMUS_REGION); offset_count++; + + LIST_FOR_EACH_ENTRY(articulation, ®ion->articulations, struct articulation, entry) + { + size += sizeof(ULONG) + sizeof(DMUS_ARTICULATION2); + size += sizeof(ULONG) + sizeof(CONNECTIONLIST); + size += articulation->list.cConnections * sizeof(CONNECTION); + offset_count += 2; + } } if (FAILED(hr = IDirectMusicPortDownload_AllocateBuffer(port, size, &download))) return hr; @@ -506,6 +556,9 @@ HRESULT instrument_download_to_port(IDirectMusicInstrument *iface, IDirectMusicP dmus_instrument->ulCopyrightIdx = 0; dmus_instrument->ulGlobalArtIdx = 0; + write_articulation_download(&This->articulations, buffer->offsets, &ptr, index, + &dmus_instrument->ulGlobalArtIdx, &index); + LIST_FOR_EACH_ENTRY(region, &This->regions, struct region, entry) { if (dmus_region) dmus_region->ulNextRegionIdx = index; @@ -532,6 +585,9 @@ HRESULT instrument_download_to_port(IDirectMusicInstrument *iface, IDirectMusicP IUnknown_Release(wave); } if (FAILED(hr)) goto failed; + + write_articulation_download(®ion->articulations, buffer->offsets, &ptr, index, + &dmus_region->ulRegionArtIdx, &index); } if (FAILED(hr = IDirectMusicPortDownload_Download(port, download))) goto failed;
1
0
0
0
Rémi Bernon : dmusic: Parse instrument regions articulation lists.
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: a788bf9641b6ed1ae0744e44aee8ae952ac1b212 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a788bf9641b6ed1ae0744e44aee8ae…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 15 09:02:57 2023 +0200 dmusic: Parse instrument regions articulation lists. --- dlls/dmusic/instrument.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c index 663e2112a06..a15a8d4e84f 100644 --- a/dlls/dmusic/instrument.c +++ b/dlls/dmusic/instrument.c @@ -36,6 +36,7 @@ C_ASSERT(sizeof(struct articulation) == offsetof(struct articulation, connection struct region { struct list entry; + struct list articulations; RGNHEADER header; WAVELINK wave_link; WSMPL wave_sample; @@ -121,6 +122,13 @@ static ULONG WINAPI instrument_Release(LPDIRECTMUSICINSTRUMENT iface) LIST_FOR_EACH_ENTRY_SAFE(region, next_region, &This->regions, struct region, entry) { + LIST_FOR_EACH_ENTRY_SAFE(articulation, next_articulation, ®ion->articulations, + struct articulation, entry) + { + list_remove(&articulation->entry); + free(articulation); + } + list_remove(®ion->entry); free(region); } @@ -221,7 +229,8 @@ static HRESULT instrument_create(struct collection *collection, IDirectMusicInst return S_OK; } -static HRESULT parse_art1_chunk(struct instrument *This, IStream *stream, struct chunk_entry *chunk) +static HRESULT parse_art1_chunk(struct instrument *This, IStream *stream, struct chunk_entry *chunk, + struct list *articulations) { struct articulation *articulation; CONNECTIONLIST list; @@ -239,12 +248,13 @@ static HRESULT parse_art1_chunk(struct instrument *This, IStream *stream, struct size = sizeof(CONNECTION) * list.cConnections; if (FAILED(hr = stream_read(stream, articulation->connections, size))) free(articulation); - else list_add_tail(&This->articulations, &articulation->entry); + else list_add_tail(articulations, &articulation->entry); return hr; } -static HRESULT parse_lart_list(struct instrument *This, IStream *stream, struct chunk_entry *parent) +static HRESULT parse_lart_list(struct instrument *This, IStream *stream, struct chunk_entry *parent, + struct list *articulations) { struct chunk_entry chunk = {.parent = parent}; HRESULT hr; @@ -254,7 +264,7 @@ static HRESULT parse_lart_list(struct instrument *This, IStream *stream, struct switch (MAKE_IDTYPE(chunk.id, chunk.type)) { case FOURCC_ART1: - hr = parse_art1_chunk(This, stream, &chunk); + hr = parse_art1_chunk(This, stream, &chunk, articulations); break; default: @@ -275,6 +285,7 @@ static HRESULT parse_rgn_chunk(struct instrument *This, IStream *stream, struct HRESULT hr; if (!(region = malloc(sizeof(*region)))) return E_OUTOFMEMORY; + list_init(®ion->articulations); while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) { @@ -299,6 +310,10 @@ static HRESULT parse_rgn_chunk(struct instrument *This, IStream *stream, struct hr = stream_chunk_get_data(stream, &chunk, ®ion->wave_link, sizeof(region->wave_link)); break; + case MAKE_IDTYPE(FOURCC_LIST, FOURCC_LART): + hr = parse_lart_list(This, stream, &chunk, ®ion->articulations); + break; + default: FIXME("Ignoring chunk %s %s\n", debugstr_fourcc(chunk.id), debugstr_fourcc(chunk.type)); break; @@ -365,7 +380,7 @@ static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct break; case MAKE_IDTYPE(FOURCC_LIST, FOURCC_LART): - hr = parse_lart_list(This, stream, &chunk); + hr = parse_lart_list(This, stream, &chunk, &This->articulations); break; default:
1
0
0
0
Rémi Bernon : dmusic: Implement downloading wave to port.
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: d32fb707ad30fad9e13d4609e4347dab55ec8a8b URL:
https://gitlab.winehq.org/wine/wine/-/commit/d32fb707ad30fad9e13d4609e4347d…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Sep 9 14:06:32 2023 +0200 dmusic: Implement downloading wave to port. --- dlls/dmusic/collection.c | 21 +++++++++++++++++++++ dlls/dmusic/dmusic_private.h | 2 ++ dlls/dmusic/instrument.c | 33 +++++++++++++++++++++++++++++++++ dlls/dmusic/tests/dmusic.c | 4 +--- dlls/dmusic/wave.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 3 deletions(-) diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index cfe7589485d..b7c11dacb77 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -72,6 +72,27 @@ extern void collection_internal_release(struct collection *collection) free(collection); } +extern HRESULT collection_get_wave(struct collection *collection, DWORD index, IUnknown **out) +{ + struct wave_entry *wave_entry; + DWORD offset; + + if (index >= collection->pool->table.cCues) return E_INVALIDARG; + offset = collection->pool->cues[index].ulOffset; + + LIST_FOR_EACH_ENTRY(wave_entry, &collection->waves, struct wave_entry, entry) + { + if (offset == wave_entry->offset) + { + *out = wave_entry->wave; + IUnknown_AddRef(wave_entry->wave); + return S_OK; + } + } + + return E_FAIL; +} + static inline struct collection *impl_from_IDirectMusicCollection(IDirectMusicCollection *iface) { return CONTAINING_RECORD(iface, struct collection, IDirectMusicCollection_iface); diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index 1f6b33ec34d..0b000fb6f1c 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -79,6 +79,7 @@ typedef struct port_info { struct collection; extern void collection_internal_addref(struct collection *collection); extern void collection_internal_release(struct collection *collection); +extern HRESULT collection_get_wave(struct collection *collection, DWORD index, IUnknown **out); /* CLSID */ extern HRESULT music_create(IUnknown **ret_iface); @@ -97,6 +98,7 @@ extern HRESULT instrument_download_to_port(IDirectMusicInstrument *iface, IDirec extern HRESULT instrument_unload_from_port(IDirectMusicDownloadedInstrument *iface, IDirectMusicPortDownload *port); extern HRESULT wave_create_from_chunk(IStream *stream, struct chunk_entry *parent, IUnknown **out); +extern HRESULT wave_download_to_port(IUnknown *iface, IDirectMusicPortDownload *port, DWORD *id); /***************************************************************************** * IDirectMusic8Impl implementation structure diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c index b79e7671c5b..663e2112a06 100644 --- a/dlls/dmusic/instrument.c +++ b/dlls/dmusic/instrument.c @@ -453,6 +453,7 @@ HRESULT instrument_download_to_port(IDirectMusicInstrument *iface, IDirectMusicP IDirectMusicDownload *download; DWORD size, offset_count; struct region *region; + IUnknown *wave; HRESULT hr; if (This->download) goto done; @@ -509,6 +510,13 @@ HRESULT instrument_download_to_port(IDirectMusicInstrument *iface, IDirectMusicP dmus_region->WaveLink = region->wave_link; dmus_region->WSMP = region->wave_sample; dmus_region->WLOOP[0] = region->wave_loop; + + if (SUCCEEDED(hr = collection_get_wave(This->collection, region->wave_link.ulTableIndex, &wave))) + { + hr = wave_download_to_port(wave, port, &dmus_region->WaveLink.ulTableIndex); + IUnknown_Release(wave); + } + if (FAILED(hr)) goto failed; } if (FAILED(hr = IDirectMusicPortDownload_Download(port, download))) goto failed; @@ -530,12 +538,37 @@ failed: HRESULT instrument_unload_from_port(IDirectMusicDownloadedInstrument *iface, IDirectMusicPortDownload *port) { struct instrument *This = impl_from_IDirectMusicDownloadedInstrument(iface); + struct download_buffer *buffer; + DWORD size; HRESULT hr; if (!This->download) return DMUS_E_NOT_DOWNLOADED_TO_PORT; if (FAILED(hr = IDirectMusicPortDownload_Unload(port, This->download))) WARN("Failed to unload instrument download buffer, hr %#lx\n", hr); + else if (SUCCEEDED(hr = IDirectMusicDownload_GetBuffer(This->download, (void **)&buffer, &size))) + { + IDirectMusicDownload *wave_download; + DMUS_INSTRUMENT *instrument; + BYTE *ptr = (BYTE *)buffer; + DMUS_REGION *region; + UINT index; + + instrument = (DMUS_INSTRUMENT *)(ptr + buffer->offsets[0]); + for (index = instrument->ulFirstRegionIdx; index; index = region->ulNextRegionIdx) + { + region = (DMUS_REGION *)(ptr + buffer->offsets[index]); + + if (FAILED(hr = IDirectMusicPortDownload_GetBuffer(port, region->WaveLink.ulTableIndex, &wave_download))) + WARN("Failed to get wave download with id %#lx, hr %#lx\n", region->WaveLink.ulTableIndex, hr); + else + { + if (FAILED(hr = IDirectMusicPortDownload_Unload(port, wave_download))) + WARN("Failed to unload wave download buffer, hr %#lx\n", hr); + IDirectMusicDownload_Release(wave_download); + } + } + } IDirectMusicDownload_Release(This->download); This->download = NULL; diff --git a/dlls/dmusic/tests/dmusic.c b/dlls/dmusic/tests/dmusic.c index 1561c51df76..879a6f800cd 100644 --- a/dlls/dmusic/tests/dmusic.c +++ b/dlls/dmusic/tests/dmusic.c @@ -1300,8 +1300,7 @@ static void test_download_instrument(void) check_interface(instrument, &IID_IDirectMusicDownloadedInstrument, FALSE); hr = IDirectMusicPort_DownloadInstrument(port, instrument, &downloaded, NULL, 0); - todo_wine ok(hr == S_OK, "got %#lx\n", hr); - if (hr != S_OK) goto skip_tests; + ok(hr == S_OK, "got %#lx\n", hr); check_interface(downloaded, &IID_IDirectMusicObject, FALSE); check_interface(downloaded, &IID_IDirectMusicDownload, FALSE); @@ -1313,7 +1312,6 @@ static void test_download_instrument(void) IDirectMusicInstrument_Release(instrument); -skip_tests: IDirectMusicCollection_Release(collection); IDirectMusicPort_Release(port); IDirectMusic_Release(dmusic); diff --git a/dlls/dmusic/wave.c b/dlls/dmusic/wave.c index cda895484cb..08146db0d1c 100644 --- a/dlls/dmusic/wave.c +++ b/dlls/dmusic/wave.c @@ -212,3 +212,46 @@ HRESULT wave_create_from_chunk(IStream *stream, struct chunk_entry *parent, IUnk *ret_iface = iface; return S_OK; } + +HRESULT wave_download_to_port(IUnknown *iface, IDirectMusicPortDownload *port, DWORD *id) +{ + struct download_buffer + { + DMUS_DOWNLOADINFO info; + ULONG offsets[2]; + DMUS_WAVE wave; + DMUS_WAVEDATA data; + } *buffer; + + struct wave *This = impl_from_IUnknown(iface); + DWORD size = offsetof(struct download_buffer, data.byData[This->data_size]); + IDirectMusicDownload *download; + HRESULT hr; + + if (FAILED(hr = IDirectMusicPortDownload_AllocateBuffer(port, size, &download))) return hr; + + if (SUCCEEDED(hr = IDirectMusicDownload_GetBuffer(download, (void **)&buffer, &size)) + && SUCCEEDED(hr = IDirectMusicPortDownload_GetDLId(port, &buffer->info.dwDLId, 1))) + { + buffer->info.dwDLType = DMUS_DOWNLOADINFO_WAVE; + buffer->info.dwNumOffsetTableEntries = 2; + buffer->info.cbSize = size; + + buffer->offsets[0] = offsetof(struct download_buffer, wave); + buffer->offsets[1] = offsetof(struct download_buffer, data); + + buffer->wave.WaveformatEx = *This->format; + buffer->wave.ulWaveDataIdx = 1; + buffer->wave.ulCopyrightIdx = 0; + buffer->wave.ulFirstExtCkIdx = 0; + + buffer->data.cbSize = This->data_size; + memcpy(buffer->data.byData, This->data, This->data_size); + + if (SUCCEEDED(hr = IDirectMusicPortDownload_Download(port, download))) *id = buffer->info.dwDLId; + else WARN("Failed to download wave to port, hr %#lx\n", hr); + } + + IDirectMusicDownload_Release(download); + return hr; +}
1
0
0
0
Rémi Bernon : dmusic: Keep an internal ref on the instrument's collection.
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: f54b0a5a9bf00de6643b9ea038532c1b2ff4952e URL:
https://gitlab.winehq.org/wine/wine/-/commit/f54b0a5a9bf00de6643b9ea038532c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 15 09:21:05 2023 +0200 dmusic: Keep an internal ref on the instrument's collection. --- dlls/dmusic/collection.c | 21 +++++++++++++++++++-- dlls/dmusic/dmusic_private.h | 6 +++++- dlls/dmusic/instrument.c | 11 +++++++---- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index 1c36f0b202d..cfe7589485d 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -48,6 +48,7 @@ struct collection { IDirectMusicCollection IDirectMusicCollection_iface; struct dmobject dmobj; + LONG internal_ref; LONG ref; DLSHEADER header; @@ -56,6 +57,21 @@ struct collection struct list waves; }; +extern void collection_internal_addref(struct collection *collection) +{ + ULONG ref = InterlockedIncrement( &collection->internal_ref ); + TRACE( "collection %p, internal ref %lu.\n", collection, ref ); +} + +extern void collection_internal_release(struct collection *collection) +{ + ULONG ref = InterlockedDecrement( &collection->internal_ref ); + TRACE( "collection %p, internal ref %lu.\n", collection, ref ); + + if (!ref) + free(collection); +} + static inline struct collection *impl_from_IDirectMusicCollection(IDirectMusicCollection *iface) { return CONTAINING_RECORD(iface, struct collection, IDirectMusicCollection_iface); @@ -128,7 +144,7 @@ static ULONG WINAPI collection_Release(IDirectMusicCollection *iface) free(wave_entry); } - free(This); + collection_internal_release(This); } return ref; @@ -201,7 +217,7 @@ static HRESULT parse_lins_list(struct collection *This, IStream *stream, struct { case MAKE_IDTYPE(FOURCC_LIST, FOURCC_INS): if (!(entry = malloc(sizeof(*entry)))) return E_OUTOFMEMORY; - hr = instrument_create_from_chunk(stream, &chunk, &entry->desc, &entry->instrument); + hr = instrument_create_from_chunk(stream, &chunk, This, &entry->desc, &entry->instrument); if (SUCCEEDED(hr)) list_add_tail(&This->instruments, &entry->entry); else free(entry); break; @@ -435,6 +451,7 @@ HRESULT collection_create(IUnknown **ret_iface) *ret_iface = NULL; if (!(collection = calloc(1, sizeof(*collection)))) return E_OUTOFMEMORY; collection->IDirectMusicCollection_iface.lpVtbl = &collection_vtbl; + collection->internal_ref = 1; collection->ref = 1; dmobject_init(&collection->dmobj, &CLSID_DirectMusicCollection, (IUnknown *)&collection->IDirectMusicCollection_iface); diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index 2fe6afde643..1f6b33ec34d 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -76,6 +76,10 @@ typedef struct port_info { * ClassFactory */ +struct collection; +extern void collection_internal_addref(struct collection *collection); +extern void collection_internal_release(struct collection *collection); + /* CLSID */ extern HRESULT music_create(IUnknown **ret_iface); extern HRESULT collection_create(IUnknown **ret_iface); @@ -87,7 +91,7 @@ extern HRESULT DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj, extern HRESULT download_create(DWORD size, IDirectMusicDownload **ret_iface); extern HRESULT instrument_create_from_chunk(IStream *stream, struct chunk_entry *parent, - DMUS_OBJECTDESC *desc, IDirectMusicInstrument **ret_iface); + struct collection *collection, DMUS_OBJECTDESC *desc, IDirectMusicInstrument **ret_iface); extern HRESULT instrument_download_to_port(IDirectMusicInstrument *iface, IDirectMusicPortDownload *port, IDirectMusicDownloadedInstrument **downloaded); extern HRESULT instrument_unload_from_port(IDirectMusicDownloadedInstrument *iface, IDirectMusicPortDownload *port); diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c index 24b3c0305f8..b79e7671c5b 100644 --- a/dlls/dmusic/instrument.c +++ b/dlls/dmusic/instrument.c @@ -51,6 +51,7 @@ struct instrument INSTHEADER header; IDirectMusicDownload *download; + struct collection *collection; struct list articulations; struct list regions; }; @@ -124,6 +125,7 @@ static ULONG WINAPI instrument_Release(LPDIRECTMUSICINSTRUMENT iface) free(region); } + collection_internal_release(This->collection); free(This); } @@ -201,7 +203,7 @@ static const IDirectMusicDownloadedInstrumentVtbl downloaded_instrument_vtbl = downloaded_instrument_Release, }; -static HRESULT instrument_create(IDirectMusicInstrument **ret_iface) +static HRESULT instrument_create(struct collection *collection, IDirectMusicInstrument **ret_iface) { struct instrument *instrument; @@ -210,6 +212,7 @@ static HRESULT instrument_create(IDirectMusicInstrument **ret_iface) instrument->IDirectMusicInstrument_iface.lpVtbl = &instrument_vtbl; instrument->IDirectMusicDownloadedInstrument_iface.lpVtbl = &downloaded_instrument_vtbl; instrument->ref = 1; + collection_internal_addref((instrument->collection = collection)); list_init(&instrument->articulations); list_init(&instrument->regions); @@ -377,15 +380,15 @@ static HRESULT parse_ins_chunk(struct instrument *This, IStream *stream, struct } HRESULT instrument_create_from_chunk(IStream *stream, struct chunk_entry *parent, - DMUS_OBJECTDESC *desc, IDirectMusicInstrument **ret_iface) + struct collection *collection, DMUS_OBJECTDESC *desc, IDirectMusicInstrument **ret_iface) { IDirectMusicInstrument *iface; struct instrument *This; HRESULT hr; - TRACE("(%p, %p)\n", stream, ret_iface); + TRACE("(%p, %p, %p, %p, %p)\n", stream, parent, collection, desc, ret_iface); - if (FAILED(hr = instrument_create(&iface))) return hr; + if (FAILED(hr = instrument_create(collection, &iface))) return hr; This = impl_from_IDirectMusicInstrument(iface); if (FAILED(hr = parse_ins_chunk(This, stream, parent, desc)))
1
0
0
0
Rémi Bernon : dmusic: Parse collection wave lists.
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: 82d1794cd49d1aedb652f7c6a07886d5178b5156 URL:
https://gitlab.winehq.org/wine/wine/-/commit/82d1794cd49d1aedb652f7c6a07886…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 15 09:00:54 2023 +0200 dmusic: Parse collection wave lists. --- dlls/dmusic/Makefile.in | 3 +- dlls/dmusic/collection.c | 14 ++- dlls/dmusic/dmusic_private.h | 2 + dlls/dmusic/wave.c | 214 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 228 insertions(+), 5 deletions(-)
1
0
0
0
Rémi Bernon : dmusic: Parse collection wave table.
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: 2f5608efd1e4e8be0a67f69d5d7885ea4b2603b3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2f5608efd1e4e8be0a67f69d5d7885…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Aug 31 13:20:17 2023 +0200 dmusic: Parse collection wave table. --- dlls/dmusic/collection.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index 5d6b533d649..3bcca3c4b8a 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -37,6 +37,12 @@ struct pool C_ASSERT(sizeof(struct pool) == offsetof(struct pool, cues[0])); +struct wave_entry +{ + struct list entry; + DWORD offset; +}; + struct collection { IDirectMusicCollection IDirectMusicCollection_iface; @@ -46,6 +52,7 @@ struct collection DLSHEADER header; struct pool *pool; struct list instruments; + struct list waves; }; static inline struct collection *impl_from_IDirectMusicCollection(IDirectMusicCollection *iface) @@ -103,6 +110,7 @@ static ULONG WINAPI collection_Release(IDirectMusicCollection *iface) if (!ref) { struct instrument_entry *instrument_entry; + struct wave_entry *wave_entry; void *next; LIST_FOR_EACH_ENTRY_SAFE(instrument_entry, next, &This->instruments, struct instrument_entry, entry) @@ -112,6 +120,12 @@ static ULONG WINAPI collection_Release(IDirectMusicCollection *iface) free(instrument_entry); } + LIST_FOR_EACH_ENTRY_SAFE(wave_entry, next, &This->waves, struct wave_entry, entry) + { + list_remove(&wave_entry->entry); + free(wave_entry); + } + free(This); } @@ -201,6 +215,33 @@ static HRESULT parse_lins_list(struct collection *This, IStream *stream, struct return hr; } +static HRESULT parse_wvpl_list(struct collection *This, IStream *stream, struct chunk_entry *parent) +{ + struct chunk_entry chunk = {.parent = parent}; + struct wave_entry *entry; + HRESULT hr; + + while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) + { + switch (MAKE_IDTYPE(chunk.id, chunk.type)) + { + case MAKE_IDTYPE(FOURCC_LIST, FOURCC_wave): + if (!(entry = malloc(sizeof(*entry)))) return E_OUTOFMEMORY; + entry->offset = chunk.offset.QuadPart - parent->offset.QuadPart - 12; + list_add_tail(&This->waves, &entry->entry); + break; + + default: + FIXME("Skipping unknown chunk %s %s\n", debugstr_fourcc(chunk.id), debugstr_fourcc(chunk.type)); + break; + } + + if (FAILED(hr)) break; + } + + return hr; +} + static HRESULT parse_ptbl_chunk(struct collection *This, IStream *stream, struct chunk_entry *chunk) { struct pool *pool; @@ -256,6 +297,10 @@ static HRESULT parse_dls_chunk(struct collection *This, IStream *stream, struct hr = parse_lins_list(This, stream, &chunk); break; + case MAKE_IDTYPE(FOURCC_LIST, FOURCC_WVPL): + hr = parse_wvpl_list(This, stream, &chunk); + break; + default: FIXME("Ignoring chunk %s %s\n", debugstr_fourcc(chunk.id), debugstr_fourcc(chunk.type)); break; @@ -336,6 +381,7 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface, IStream *str if (TRACE_ON(dmusic)) { struct instrument_entry *entry; + struct wave_entry *wave_entry; int i = 0; TRACE("*** IDirectMusicCollection (%p) ***\n", &This->IDirectMusicCollection_iface); @@ -346,7 +392,18 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface, IStream *str TRACE(" - Instruments:\n"); LIST_FOR_EACH_ENTRY(entry, &This->instruments, struct instrument_entry, entry) - TRACE(" - Instrument[%i]: %p\n", i++, entry->instrument); + { + TRACE(" - Instrument[%i]: %p\n", i, entry->instrument); + i++; + } + + TRACE(" - cues: size %lu\n", This->pool->table.cbSize); + for (i = 0; i < This->pool->table.cCues; i++) + TRACE(" - index: %u, offset: %lu\n", i, This->pool->cues[i].ulOffset); + + TRACE(" - waves:\n"); + LIST_FOR_EACH_ENTRY(wave_entry, &This->waves, struct wave_entry, entry) + TRACE(" - offset: %lu\n", wave_entry->offset); } stream_skip_chunk(stream, &chunk); @@ -378,6 +435,7 @@ HRESULT collection_create(IUnknown **ret_iface) collection->dmobj.IDirectMusicObject_iface.lpVtbl = &collection_object_vtbl; collection->dmobj.IPersistStream_iface.lpVtbl = &collection_stream_vtbl; list_init(&collection->instruments); + list_init(&collection->waves); TRACE("Created DirectMusicCollection %p\n", collection); *ret_iface = (IUnknown *)&collection->IDirectMusicCollection_iface;
1
0
0
0
Rémi Bernon : dmusic: Rewrite downloading instrument to port.
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: 120a743c96c9632eb37ff6b8f5ccfb199ffb764b URL:
https://gitlab.winehq.org/wine/wine/-/commit/120a743c96c9632eb37ff6b8f5ccfb…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Sep 9 14:06:32 2023 +0200 dmusic: Rewrite downloading instrument to port. --- dlls/dmusic/dmusic_private.h | 43 +---------- dlls/dmusic/instrument.c | 174 +++++++++++++++++++++++++++++++++++++++++++ dlls/dmusic/port.c | 172 +----------------------------------------- 3 files changed, 180 insertions(+), 209 deletions(-)
1
0
0
0
Rémi Bernon : dmusic: Avoid swallowing collection Load failures.
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: 0cb208cec2f03cef0e42d98f238fe126abc941d0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0cb208cec2f03cef0e42d98f238fe1…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 15 11:27:46 2023 +0200 dmusic: Avoid swallowing collection Load failures. --- dlls/dmusic/collection.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index cbcdabb37c1..5d6b533d649 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -331,7 +331,9 @@ static HRESULT WINAPI collection_stream_Load(IPersistStream *iface, IStream *str } } - if (SUCCEEDED(hr) && TRACE_ON(dmusic)) + if (FAILED(hr)) return hr; + + if (TRACE_ON(dmusic)) { struct instrument_entry *entry; int i = 0;
1
0
0
0
Huw Davies : gdiplus: Copy the compound array in GdipClonePen().
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: 150b8dd013a686017eb696989dcc0b1b2121e7eb URL:
https://gitlab.winehq.org/wine/wine/-/commit/150b8dd013a686017eb696989dcc0b…
Author: Huw Davies <huw(a)codeweavers.com> Date: Fri Sep 15 17:43:48 2023 +0100 gdiplus: Copy the compound array in GdipClonePen(). --- dlls/gdiplus/pen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 6446b725e4d..fac31d6e84e 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -103,6 +103,7 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) (*clonepen)->customend = NULL; (*clonepen)->brush = NULL; (*clonepen)->dashes = NULL; + (*clonepen)->compound_array = NULL; stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush); @@ -121,6 +122,15 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) stat = OutOfMemory; } + if (stat == Ok && pen->compound_array) + { + (*clonepen)->compound_array = heap_alloc_zero(pen->compound_array_size * sizeof(REAL)); + if ((*clonepen)->compound_array) + memcpy((*clonepen)->compound_array, pen->compound_array, pen->compound_array_size * sizeof(REAL)); + else + stat = OutOfMemory; + } + if (stat != Ok) { GdipDeletePen(*clonepen);
1
0
0
0
Connor McAdams : uiautomationcore: Implement UiaHasServerSideProvider.
by Alexandre Julliard
18 Sep '23
18 Sep '23
Module: wine Branch: master Commit: f0525a5ff6c9bf35d6704a24aa95d1dcc45d71b6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f0525a5ff6c9bf35d6704a24aa95d1…
Author: Connor McAdams <cmcadams(a)codeweavers.com> Date: Mon Aug 21 10:28:33 2023 -0400 uiautomationcore: Implement UiaHasServerSideProvider. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 59 ++++++++++++++++++++++++++++++ dlls/uiautomationcore/uia_client.c | 54 +++++++++++++++++++-------- dlls/uiautomationcore/uia_private.h | 8 ++++ 3 files changed, 105 insertions(+), 16 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index a733e183312..fd1f5d0414b 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -15302,6 +15302,64 @@ static void test_UiaAddEvent(const char *name) UnregisterClassA("UiaAddEvent test class", NULL); } +static const struct prov_method_sequence serverside_prov_seq[] = { + NODE_CREATE_SEQ2(&Provider), + /* Windows 10+ calls this. */ + { &Provider, PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL }, + { 0 } +}; + +static void test_UiaHasServerSideProvider(void) +{ + BOOL ret_val; + HWND hwnd; + + CoInitializeEx(NULL, COINIT_MULTITHREADED); + hwnd = create_test_hwnd("UiaHasServerSideProvider test class"); + + /* NULL hwnd. */ + ret_val = UiaHasServerSideProvider(NULL); + ok(!ret_val, "UiaHasServerSideProvider returned TRUE\n"); + + /* Desktop window has no serverside providers. */ + UiaRegisterProviderCallback(test_uia_provider_callback); + ret_val = UiaHasServerSideProvider(GetDesktopWindow()); + ok(!ret_val, "UiaHasServerSideProvider returned TRUE\n"); + + /* No provider to pass to UiaReturnRawElementProvider, returns FALSE. */ + prov_root = NULL; + SET_EXPECT(winproc_GETOBJECT_UiaRoot); + ret_val = UiaHasServerSideProvider(hwnd); + ok(!ret_val, "UiaHasServerSideProvider returned TRUE\n"); + CHECK_CALLED(winproc_GETOBJECT_UiaRoot); + + /* + * Provider passed to UiaReturnRawElementProvider returns a failure from + * get_ProviderOptions. Returns FALSE. + */ + initialize_provider(&Provider, 0, hwnd, TRUE); + prov_root = &Provider.IRawElementProviderSimple_iface; + SET_EXPECT(winproc_GETOBJECT_UiaRoot); + ret_val = UiaHasServerSideProvider(hwnd); + ok(!ret_val, "UiaHasServerSideProvider returned TRUE\n"); + ok_method_sequence(node_from_hwnd1, NULL); + CHECK_CALLED(winproc_GETOBJECT_UiaRoot); + + /* Successfully return a provider from UiaReturnRawElementProvider. */ + initialize_provider(&Provider, ProviderOptions_ServerSideProvider, hwnd, TRUE); + SET_EXPECT(winproc_GETOBJECT_UiaRoot); + ret_val = UiaHasServerSideProvider(hwnd); + ok(ret_val, "UiaHasServerSideProvider returned FALSE\n"); + ok_method_sequence(serverside_prov_seq, "serverside_prov_seq"); + CHECK_CALLED(winproc_GETOBJECT_UiaRoot); + + UiaRegisterProviderCallback(NULL); + prov_root = NULL; + CoUninitialize(); + DestroyWindow(hwnd); + UnregisterClassA("UiaHasServerSideProvider test class", NULL); +} + /* * Once a process returns a UI Automation provider with * UiaReturnRawElementProvider it ends up in an implicit MTA until exit. This @@ -15375,6 +15433,7 @@ START_TEST(uiautomation) test_UiaGetRootNode(); test_UiaNodeFromFocus(); test_UiaAddEvent(argv[0]); + test_UiaHasServerSideProvider(); if (uia_dll) { pUiaProviderFromIAccessible = (void *)GetProcAddress(uia_dll, "UiaProviderFromIAccessible"); diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c index b1a21de3a17..57d1ca812f7 100644 --- a/dlls/uiautomationcore/uia_client.c +++ b/dlls/uiautomationcore/uia_client.c @@ -597,7 +597,7 @@ static struct uia_node *unsafe_impl_from_IWineUiaNode(IWineUiaNode *iface) return CONTAINING_RECORD(iface, struct uia_node, IWineUiaNode_iface); } -static HRESULT create_uia_node(struct uia_node **out_node) +static HRESULT create_uia_node(struct uia_node **out_node, int node_flags) { struct uia_node *node; @@ -609,6 +609,10 @@ static HRESULT create_uia_node(struct uia_node **out_node) list_init(&node->prov_thread_list_entry); list_init(&node->node_map_list_entry); node->ref = 1; + if (node_flags & NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS) + node->ignore_clientside_hwnd_provs = TRUE; + if (node_flags & NODE_FLAG_NO_PREPARE) + node->no_prepare = TRUE; *out_node = node; return S_OK; @@ -620,6 +624,9 @@ static HRESULT prepare_uia_node(struct uia_node *node) int i, prov_idx; HRESULT hr; + if (node->no_prepare) + return S_OK; + /* Get the provider index for the provider that created the node. */ for (i = prov_idx = 0; i < PROV_TYPE_COUNT; i++) { @@ -714,7 +721,7 @@ HRESULT clone_uia_node(HUIANODE in_node, HUIANODE *out_node) } } - hr = create_uia_node(&node); + hr = create_uia_node(&node, 0); if (FAILED(hr)) return hr; @@ -1980,7 +1987,7 @@ HRESULT create_uia_node_from_elprov(IRawElementProviderSimple *elprov, HUIANODE else prov_type = PROV_TYPE_MAIN; - hr = create_uia_node(&node); + hr = create_uia_node(&node, 0); if (FAILED(hr)) return hr; @@ -2503,7 +2510,7 @@ HRESULT uia_node_from_lresult(LRESULT lr, HUIANODE *huianode) *huianode = NULL; - hr = create_uia_node(&node); + hr = create_uia_node(&node, 0); if (FAILED(hr)) return hr; @@ -2564,25 +2571,20 @@ static HRESULT uia_get_provider_from_hwnd(struct uia_node *node) return SendMessageW(client_thread.hwnd, WM_UIA_CLIENT_GET_NODE_PROV, (WPARAM)&args, (LPARAM)node); } -/*********************************************************************** - * UiaNodeFromHandle (uiautomationcore.@) - */ -HRESULT WINAPI UiaNodeFromHandle(HWND hwnd, HUIANODE *huianode) +static HRESULT create_uia_node_from_hwnd(HWND hwnd, HUIANODE *out_node, int node_flags) { struct uia_node *node; HRESULT hr; - TRACE("(%p, %p)\n", hwnd, huianode); - - if (!huianode) + if (!out_node) return E_INVALIDARG; - *huianode = NULL; + *out_node = NULL; if (!IsWindow(hwnd)) return UIA_E_ELEMENTNOTAVAILABLE; - hr = create_uia_node(&node); + hr = create_uia_node(&node, node_flags); if (FAILED(hr)) return hr; @@ -2601,11 +2603,21 @@ HRESULT WINAPI UiaNodeFromHandle(HWND hwnd, HUIANODE *huianode) return hr; } - *huianode = (void *)&node->IWineUiaNode_iface; + *out_node = (void *)&node->IWineUiaNode_iface; return S_OK; } +/*********************************************************************** + * UiaNodeFromHandle (uiautomationcore.@) + */ +HRESULT WINAPI UiaNodeFromHandle(HWND hwnd, HUIANODE *huianode) +{ + TRACE("(%p, %p)\n", hwnd, huianode); + + return create_uia_node_from_hwnd(hwnd, huianode, 0); +} + /*********************************************************************** * UiaGetRootNode (uiautomationcore.@) */ @@ -2621,8 +2633,15 @@ HRESULT WINAPI UiaGetRootNode(HUIANODE *huianode) */ BOOL WINAPI UiaHasServerSideProvider(HWND hwnd) { - FIXME("(%p): stub\n", hwnd); - return FALSE; + HUIANODE node = NULL; + HRESULT hr; + + TRACE("(%p)\n", hwnd); + + hr = create_uia_node_from_hwnd(hwnd, &node, NODE_FLAG_NO_PREPARE | NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS); + UiaNodeRelease(node); + + return SUCCEEDED(hr); } static HRESULT get_focused_uia_node(HUIANODE in_node, HUIANODE *out_node) @@ -3026,6 +3045,9 @@ static HRESULT uia_get_clientside_provider(struct uia_node *node, int prov_type, VARTYPE vt; HRESULT hr; + if (node->ignore_clientside_hwnd_provs) + return S_OK; + if (!(sa = uia_provider_callback(node->hwnd, prov_type))) return S_OK; diff --git a/dlls/uiautomationcore/uia_private.h b/dlls/uiautomationcore/uia_private.h index 253eacbc4e7..e8bb4845189 100644 --- a/dlls/uiautomationcore/uia_private.h +++ b/dlls/uiautomationcore/uia_private.h @@ -54,6 +54,11 @@ enum uia_node_prov_type { PROV_TYPE_COUNT, }; +enum uia_node_flags { + NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS = 0x01, + NODE_FLAG_NO_PREPARE = 0x02, +}; + struct uia_node { IWineUiaNode IWineUiaNode_iface; LONG ref; @@ -65,9 +70,12 @@ struct uia_node { int creator_prov_idx; HWND hwnd; + BOOL no_prepare; BOOL nested_node; BOOL disconnected; int creator_prov_type; + BOOL ignore_clientside_hwnd_provs; + struct list prov_thread_list_entry; struct list node_map_list_entry; struct uia_provider_thread_map_entry *map;
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
92
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200