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
Jacek Caban : include: Move __getReg intrinsic to intrin.h.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: 71ebc22d635e30e5e9d37fac0ebb5da7cee90b7f URL:
https://gitlab.winehq.org/wine/wine/-/commit/71ebc22d635e30e5e9d37fac0ebb5d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 29 10:46:30 2023 +0200 include: Move __getReg intrinsic to intrin.h. --- include/msvcrt/intrin.h | 7 +++++++ include/winnt.h | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/msvcrt/intrin.h b/include/msvcrt/intrin.h index d92f918ce82..7981e2798ba 100644 --- a/include/msvcrt/intrin.h +++ b/include/msvcrt/intrin.h @@ -66,6 +66,13 @@ void __dmb(unsigned int); #endif +#if defined(_MSC_VER) && (defined(__aarch64__) || defined(__arm64ec__)) + +unsigned __int64 __getReg(int); +#pragma intrinsic(__getReg) + +#endif + #ifdef __cplusplus } #endif diff --git a/include/winnt.h b/include/winnt.h index df0c3282f8c..79fa8d6077b 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -2439,8 +2439,6 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) return __wine_current_teb; } #elif defined(__aarch64__) && defined(_MSC_VER) -unsigned __int64 __getReg(int); -#pragma intrinsic(__getReg) static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) { return (struct _TEB *)__getReg(18);
1
0
0
0
Jacek Caban : include: Support ARM64EC target in intrin.h.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: 12c019ff84ea410ff83cf807ffc8653bbec607a4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/12c019ff84ea410ff83cf807ffc865…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 29 10:17:48 2023 +0200 include: Support ARM64EC target in intrin.h. --- include/msvcrt/intrin.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/msvcrt/intrin.h b/include/msvcrt/intrin.h index 8b84929bc02..d92f918ce82 100644 --- a/include/msvcrt/intrin.h +++ b/include/msvcrt/intrin.h @@ -7,7 +7,7 @@ #ifndef _INC_INTRIN #define _INC_INTRIN -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || (defined(__x86_64__) && !defined(__arm64ec__)) # include <x86intrin.h> #endif @@ -15,7 +15,7 @@ extern "C" { #endif -#if defined(__i386__) || defined(__x86_64__) +#if defined(__i386__) || (defined(__x86_64__) && !defined(__arm64ec__)) static inline void __cpuidex(int info[4], int ax, int cx) { __asm__ ("cpuid" : "=a"(info[0]), "=b" (info[1]), "=c"(info[2]), "=d"(info[3]) : "a"(ax), "c"(cx)); @@ -26,7 +26,7 @@ static inline void __cpuid(int info[4], int ax) } #endif -#ifdef __aarch64__ +#if defined(__aarch64__) || defined(__arm64ec__) typedef enum _tag_ARM64INTR_BARRIER_TYPE { _ARM64_BARRIER_OSHLD = 0x1, @@ -58,7 +58,7 @@ typedef enum _tag_ARMINTR_BARRIER_TYPE } _ARMINTR_BARRIER_TYPE; #endif -#if defined(_MSC_VER) && (defined(__arm__) || defined(__aarch64__)) +#if defined(_MSC_VER) && (defined(__arm__) || defined(__aarch64__) || defined(__arm64ec__)) void __dmb(unsigned int);
1
0
0
0
Rémi Bernon : dmusic: Implement SoundFont2 instrument parsing.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: 086e114f05e89a9b670b9ef738b017f3d65004d8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/086e114f05e89a9b670b9ef738b017…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 21 09:13:43 2023 +0200 dmusic: Implement SoundFont2 instrument parsing. --- dlls/dmusic/collection.c | 11 ++ dlls/dmusic/dmusic_private.h | 2 + dlls/dmusic/instrument.c | 239 +++++++++++++++++++++++++++++++++++++++++++ dlls/dmusic/tests/dmusic.c | 3 +- 4 files changed, 254 insertions(+), 1 deletion(-)
1
0
0
0
Rémi Bernon : dmusic: Implement SoundFont2 wave sample parsing.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: 215a55d603bdaf501aae1df1db328131a314b443 URL:
https://gitlab.winehq.org/wine/wine/-/commit/215a55d603bdaf501aae1df1db3281…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 21 09:05:55 2023 +0200 dmusic: Implement SoundFont2 wave sample parsing. --- dlls/dmusic/collection.c | 23 +++++++++++++ dlls/dmusic/dmusic_private.h | 2 ++ dlls/dmusic/wave.c | 80 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) diff --git a/dlls/dmusic/collection.c b/dlls/dmusic/collection.c index feda1cbf8a9..a7d9d666e6c 100644 --- a/dlls/dmusic/collection.c +++ b/dlls/dmusic/collection.c @@ -580,6 +580,29 @@ static HRESULT parse_sfbk_chunk(struct collection *This, IStream *stream, struct } } + if (SUCCEEDED(hr)) + { + UINT size = offsetof(struct pool, cues[soundfont.sample_count]); + if (!(This->pool = calloc(1, size))) return E_OUTOFMEMORY; + This->pool->table.cbSize = sizeof(This->pool->table); + } + + for (i = 0; SUCCEEDED(hr) && i < soundfont.sample_count; i++) + { + struct wave_entry *entry; + + if (!(entry = malloc(sizeof(*entry)))) return E_OUTOFMEMORY; + hr = wave_create_from_soundfont(&soundfont, i, &entry->wave); + if (FAILED(hr)) free(entry); + else + { + entry->offset = i; + This->pool->table.cCues++; + This->pool->cues[i].ulOffset = i; + list_add_tail(&This->waves, &entry->entry); + } + } + free(soundfont.phdr); free(soundfont.pbag); free(soundfont.pmod); diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index 0b000fb6f1c..232bbcd0c94 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -91,12 +91,14 @@ extern HRESULT DMUSIC_CreateReferenceClockImpl (LPCGUID lpcGUID, LPVOID* ppobj, extern HRESULT download_create(DWORD size, IDirectMusicDownload **ret_iface); +struct soundfont; extern HRESULT instrument_create_from_chunk(IStream *stream, struct chunk_entry *parent, 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); +extern HRESULT wave_create_from_soundfont(struct soundfont *soundfont, UINT index, IUnknown **out); 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); diff --git a/dlls/dmusic/wave.c b/dlls/dmusic/wave.c index 6637612596a..40a8c9e129f 100644 --- a/dlls/dmusic/wave.c +++ b/dlls/dmusic/wave.c @@ -17,6 +17,7 @@ */ #include "dmusic_private.h" +#include "soundfont.h" WINE_DEFAULT_DEBUG_CHANNEL(dmusic); @@ -216,6 +217,85 @@ HRESULT wave_create_from_chunk(IStream *stream, struct chunk_entry *parent, IUnk return S_OK; } +HRESULT wave_create_from_soundfont(struct soundfont *soundfont, UINT index, IUnknown **ret_iface) +{ + struct sf_sample *sf_sample = soundfont->shdr + index; + struct sample *sample = NULL; + WAVEFORMATEX *format = NULL; + HRESULT hr = E_OUTOFMEMORY; + UINT data_size, offset; + struct wave *This; + void *data = NULL; + IUnknown *iface; + + TRACE("(%p, %u, %p)\n", soundfont, index, ret_iface); + + if (sf_sample->sample_link) FIXME("Stereo sample not supported\n"); + + if (!(format = calloc(1, sizeof(*format)))) goto failed; + format->wFormatTag = WAVE_FORMAT_PCM; + format->nChannels = 1; + format->wBitsPerSample = 16; + format->nSamplesPerSec = sf_sample->sample_rate; + format->nBlockAlign = format->wBitsPerSample * format->nChannels / 8; + format->nAvgBytesPerSec = format->nBlockAlign * format->nSamplesPerSec; + + if (!(sample = calloc(1, offsetof(struct sample, loops[1])))) goto failed; + sample->head.cbSize = sizeof(sample->head); + sample->head.cSampleLoops = 1; + sample->loops[0].ulStart = sf_sample->start_loop - sf_sample->start; + sample->loops[0].ulLength = sf_sample->end_loop - sf_sample->start_loop; + + data_size = sf_sample->end - sf_sample->start; + if (!(data = malloc(data_size * format->nBlockAlign))) goto failed; + offset = sf_sample->start * format->nBlockAlign / format->nChannels; + memcpy(data, soundfont->sdta + offset, data_size); + + if (FAILED(hr = wave_create(&iface))) goto failed; + + This = impl_from_IUnknown(iface); + This->format = format; + This->sample = sample; + This->data_size = data_size; + This->data = data; + + if (TRACE_ON(dmusic)) + { + UINT i; + + TRACE("*** Created DirectMusicWave %p\n", This); + TRACE(" - format: %p\n", This->format); + if (This->format) + { + TRACE(" - wFormatTag: %u\n", This->format->wFormatTag); + TRACE(" - nChannels: %u\n", This->format->nChannels); + TRACE(" - nSamplesPerSec: %lu\n", This->format->nSamplesPerSec); + TRACE(" - nAvgBytesPerSec: %lu\n", This->format->nAvgBytesPerSec); + TRACE(" - nBlockAlign: %u\n", This->format->nBlockAlign); + TRACE(" - wBitsPerSample: %u\n", This->format->wBitsPerSample); + TRACE(" - cbSize: %u\n", This->format->cbSize); + } + + TRACE(" - sample: {size: %lu, unity_note: %u, fine_tune: %d, attenuation: %ld, options: %#lx, loops: %lu}\n", + This->sample->head.cbSize, This->sample->head.usUnityNote, + This->sample->head.sFineTune, This->sample->head.lAttenuation, + This->sample->head.fulOptions, This->sample->head.cSampleLoops); + for (i = 0; i < This->sample->head.cSampleLoops; i++) + TRACE(" - loops[%u]: {size: %lu, type: %lu, start: %lu, length: %lu}\n", i, + This->sample->loops[i].cbSize, This->sample->loops[i].ulType, + This->sample->loops[i].ulStart, This->sample->loops[i].ulLength); + } + + *ret_iface = iface; + return S_OK; + +failed: + free(data); + free(sample); + free(format); + return hr; +} + HRESULT wave_download_to_port(IUnknown *iface, IDirectMusicPortDownload *port, DWORD *id) { struct download_buffer
1
0
0
0
Rémi Bernon : dmusic: Implement SoundFont2 collection parsing.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: b733a46adae2af03d364bac9a0ecfd83390d25d3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b733a46adae2af03d364bac9a0ecfd…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 21 09:11:55 2023 +0200 dmusic: Implement SoundFont2 collection parsing. --- dlls/dmime/tests/dmime.c | 2 +- dlls/dmusic/collection.c | 249 +++++++++++++++++++++++++++++++++- dlls/dmusic/soundfont.h | 323 +++++++++++++++++++++++++++++++++++++++++++++ dlls/dmusic/tests/dmusic.c | 6 +- 4 files changed, 574 insertions(+), 6 deletions(-)
1
0
0
0
Rémi Bernon : dmusic: Avoid crashing in traces if wave doesn't have a WSMPL.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: 182338bab26cdfd904336c0a0508537ad8e62d47 URL:
https://gitlab.winehq.org/wine/wine/-/commit/182338bab26cdfd904336c0a050853…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 26 08:28:19 2023 +0200 dmusic: Avoid crashing in traces if wave doesn't have a WSMPL. --- dlls/dmusic/wave.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/dlls/dmusic/wave.c b/dlls/dmusic/wave.c index 08146db0d1c..6637612596a 100644 --- a/dlls/dmusic/wave.c +++ b/dlls/dmusic/wave.c @@ -199,14 +199,17 @@ HRESULT wave_create_from_chunk(IStream *stream, struct chunk_entry *parent, IUnk TRACE(" - wBitsPerSample: %u\n", This->format->wBitsPerSample); TRACE(" - cbSize: %u\n", This->format->cbSize); } - TRACE(" - sample: {size: %lu, unity_note: %u, fine_tune: %d, attenuation: %ld, options: %#lx, loops: %lu}\n", - This->sample->head.cbSize, This->sample->head.usUnityNote, - This->sample->head.sFineTune, This->sample->head.lAttenuation, - This->sample->head.fulOptions, This->sample->head.cSampleLoops); - for (i = 0; i < This->sample->head.cSampleLoops; i++) - TRACE(" - loops[%u]: {size: %lu, type: %lu, start: %lu, length: %lu}\n", i, - This->sample->loops[i].cbSize, This->sample->loops[i].ulType, - This->sample->loops[i].ulStart, This->sample->loops[i].ulLength); + if (This->sample) + { + TRACE(" - sample: {size: %lu, unity_note: %u, fine_tune: %d, attenuation: %ld, options: %#lx, loops: %lu}\n", + This->sample->head.cbSize, This->sample->head.usUnityNote, + This->sample->head.sFineTune, This->sample->head.lAttenuation, + This->sample->head.fulOptions, This->sample->head.cSampleLoops); + for (i = 0; i < This->sample->head.cSampleLoops; i++) + TRACE(" - loops[%u]: {size: %lu, type: %lu, start: %lu, length: %lu}\n", i, + This->sample->loops[i].cbSize, This->sample->loops[i].ulType, + This->sample->loops[i].ulStart, This->sample->loops[i].ulLength); + } } *ret_iface = iface;
1
0
0
0
Rémi Bernon : dmusic: Avoid leaking articulations when freeing regions.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: 2a1fd9851c33fae7d8cc3b6ef63e9bf8a0effe4f URL:
https://gitlab.winehq.org/wine/wine/-/commit/2a1fd9851c33fae7d8cc3b6ef63e9b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 22 20:56:17 2023 +0200 dmusic: Avoid leaking articulations when freeing regions. --- dlls/dmusic/instrument.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/dlls/dmusic/instrument.c b/dlls/dmusic/instrument.c index 8ce3c0bc979..54ce7508ee4 100644 --- a/dlls/dmusic/instrument.c +++ b/dlls/dmusic/instrument.c @@ -44,6 +44,19 @@ struct region BOOL loop_present; }; +static void region_destroy(struct region *region) +{ + struct articulation *articulation, *next; + + LIST_FOR_EACH_ENTRY_SAFE(articulation, next, ®ion->articulations, struct articulation, entry) + { + list_remove(&articulation->entry); + free(articulation); + } + + free(region); +} + struct instrument { IDirectMusicInstrument IDirectMusicInstrument_iface; @@ -122,15 +135,8 @@ 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); + region_destroy(region); } collection_internal_release(This->collection); @@ -322,7 +328,7 @@ static HRESULT parse_rgn_chunk(struct instrument *This, IStream *stream, struct if (FAILED(hr)) break; } - if (FAILED(hr)) free(region); + if (FAILED(hr)) region_destroy(region); else list_add_tail(&This->regions, ®ion->entry); return hr;
1
0
0
0
Rémi Bernon : dmloader: Add fallbacks if the configured GMFilePath doesn't exist.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: 8e881787fc542355e8a9422590fdbbb334f63450 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8e881787fc542355e8a9422590fdbb…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 26 15:12:45 2023 +0200 dmloader: Add fallbacks if the configured GMFilePath doesn't exist. --- dlls/dmloader/loader.c | 67 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 15 deletions(-) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index d15c99f6fb6..78b9790dff3 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -20,6 +20,32 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmloader); +static const WCHAR *system_default_gm_paths[] = +{ + L"/usr/share/sounds/sf2/default-GM.sf2", + L"/usr/share/soundfonts/default.sf2", +}; + +static HRESULT get_system_default_gm_path(WCHAR *path, UINT max_len) +{ + UINT i; + + for (i = 0; i < ARRAY_SIZE(system_default_gm_paths); i++) + { + swprintf(path, max_len, L"\\??\\unix%s", system_default_gm_paths[i]); + if (GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES) break; + } + + if (i < ARRAY_SIZE(system_default_gm_paths)) + { + WARN("Using system %s for the default collection\n", debugstr_w(path)); + return S_OK; + } + + ERR("Unable to find system path, default collection will not be available\n"); + return DMUS_E_LOADER_FAILEDOPEN; +} + static const GUID *classes[] = { &GUID_DirectMusicAllTypes, /* Keep as first */ &CLSID_DirectMusicAudioPathConfig, @@ -458,6 +484,13 @@ static HRESULT WINAPI loader_SetObject(IDirectMusicLoader8 *iface, DMUS_OBJECTDE lstrcpyW(p, pDesc->wszFileName); } + if (!wcsicmp(file_name, L"C:\\windows\\system32\\drivers\\gm.dls") + && GetFileAttributesW(file_name) == INVALID_FILE_ATTRIBUTES) + { + hr = get_system_default_gm_path(file_name, ARRAY_SIZE(file_name)); + if (FAILED(hr)) return hr; + } + if (FAILED(hr = file_stream_create(file_name, &pStream))) return hr; } else if (pDesc->dwValidData & DMUS_OBJ_STREAM) @@ -847,21 +880,24 @@ static const IDirectMusicLoader8Vtbl loader_vtbl = loader_LoadObjectFromFile, }; -/* help function for DMUSIC_SetDefaultDLS */ -static HRESULT DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]) { - HKEY hkDM; - DWORD returnType, sizeOfReturnBuffer = MAX_PATH; - char szPath[MAX_PATH]; +static HRESULT get_default_gm_path(WCHAR *path, DWORD max_len) +{ + DWORD ret; + HKEY hkey; + + if (!(ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\DirectMusic" , 0, KEY_READ, &hkey))) + { + DWORD type, size = max_len * sizeof(WCHAR); + ret = RegQueryValueExW(hkey, L"GMFilePath", NULL, &type, (BYTE *)path, &size); + RegCloseKey(hkey); - if ((RegOpenKeyExA (HKEY_LOCAL_MACHINE, "Software\\Microsoft\\DirectMusic" , 0, KEY_READ, &hkDM) != ERROR_SUCCESS) || - (RegQueryValueExA (hkDM, "GMFilePath", NULL, &returnType, (LPBYTE) szPath, &sizeOfReturnBuffer) != ERROR_SUCCESS)) { - WARN(": registry entry missing\n" ); - return E_FAIL; - } - /* FIXME: Check return types to ensure we're interpreting data right */ - MultiByteToWideChar (CP_ACP, 0, szPath, -1, wszPath, MAX_PATH); + if (!ret && GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES) return S_OK; + } - return S_OK; + if (!ret) WARN("Failed to find %s, using system fallbacks\n", debugstr_w(path)); + else WARN("Failed to open GMFilePath registry key, using system fallbacks\n"); + + return get_system_default_gm_path(path, max_len); } /* for ClassFactory */ @@ -886,8 +922,9 @@ HRESULT create_dmloader(REFIID lpcGUID, void **ppobj) Desc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH | DMUS_OBJ_OBJECT; Desc.guidClass = CLSID_DirectMusicCollection; Desc.guidObject = GUID_DefaultGMCollection; - DMUSIC_GetDefaultGMPath(Desc.wszFileName); - IDirectMusicLoader_SetObject(&obj->IDirectMusicLoader8_iface, &Desc); + if (SUCCEEDED(hr = get_default_gm_path(Desc.wszFileName, ARRAY_SIZE(Desc.wszFileName)))) + hr = IDirectMusicLoader_SetObject(&obj->IDirectMusicLoader8_iface, &Desc); + if (FAILED(hr)) WARN("Failed to load the default collection, hr %#lx\n", hr); hr = IDirectMusicLoader_QueryInterface(&obj->IDirectMusicLoader8_iface, lpcGUID, ppobj); IDirectMusicLoader_Release(&obj->IDirectMusicLoader8_iface);
1
0
0
0
Rémi Bernon : dmloader: Remove invalid default DLS collection check.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: 49c6e57d95d6f7d7647b132ea658ef0705b27d1d URL:
https://gitlab.winehq.org/wine/wine/-/commit/49c6e57d95d6f7d7647b132ea658ef…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 26 08:22:38 2023 +0200 dmloader: Remove invalid default DLS collection check. --- dlls/dmloader/loader.c | 54 ++++++++++++++++++-------------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index 9c97f47e5f7..d15c99f6fb6 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -40,7 +40,6 @@ struct cache_entry { struct list entry; DMUS_OBJECTDESC Desc; IDirectMusicObject *pObject; - BOOL bInvalidDefaultDLS; /* workaround for enabling caching of "faulty" default dls collection */ }; struct loader @@ -276,12 +275,6 @@ static HRESULT WINAPI loader_GetObject(IDirectMusicLoader8 *iface, DMUS_OBJECTDE TRACE(": looking if we have object in the cache or if it can be found via alias\n"); pExistingEntry = find_cache_object(This, pDesc); if (pExistingEntry) { - - if (pExistingEntry->bInvalidDefaultDLS) { - TRACE(": found faulty default DLS collection... enabling M$ compliant behaviour\n"); - return DMUS_E_LOADER_NOFILENAME; - } - if (pExistingEntry->Desc.dwValidData & DMUS_OBJ_LOADED) { TRACE(": already loaded\n"); return IDirectMusicObject_QueryInterface(pExistingEntry->pObject, riid, ppv); @@ -404,23 +397,26 @@ static HRESULT WINAPI loader_GetObject(IDirectMusicLoader8 *iface, DMUS_OBJECTDE IStream_Release (pStream); IPersistStream_Release (pPersistStream); - /* add object to cache/overwrite existing info (if cache is enabled) */ - bCache = is_cache_enabled(This, &pDesc->guidClass); - if (bCache) { - if (!pObjectEntry) { + /* add object to cache/overwrite existing info (if cache is enabled) */ + bCache = is_cache_enabled(This, &pDesc->guidClass); + if (!bCache) TRACE(": caching disabled\n"); + else + { + if (!pObjectEntry) + { pObjectEntry = calloc(1, sizeof(*pObjectEntry)); - DM_STRUCT_INIT(&pObjectEntry->Desc); - DMUSIC_CopyDescriptor (&pObjectEntry->Desc, &GotDesc); - pObjectEntry->pObject = pObject; - pObjectEntry->bInvalidDefaultDLS = FALSE; - list_add_head(&This->cache, &pObjectEntry->entry); - } else { - DMUSIC_CopyDescriptor (&pObjectEntry->Desc, &GotDesc); - pObjectEntry->pObject = pObject; - pObjectEntry->bInvalidDefaultDLS = FALSE; - } - TRACE(": filled in cache entry\n"); - } else TRACE(": caching disabled\n"); + DM_STRUCT_INIT(&pObjectEntry->Desc); + DMUSIC_CopyDescriptor (&pObjectEntry->Desc, &GotDesc); + pObjectEntry->pObject = pObject; + list_add_head(&This->cache, &pObjectEntry->entry); + } + else + { + DMUSIC_CopyDescriptor (&pObjectEntry->Desc, &GotDesc); + pObjectEntry->pObject = pObject; + } + TRACE(": filled in cache entry\n"); + } result = IDirectMusicObject_QueryInterface (pObject, riid, ppv); if (!bCache) IDirectMusicObject_Release (pObject); /* since loader's reference is not needed */ @@ -873,8 +869,6 @@ HRESULT create_dmloader(REFIID lpcGUID, void **ppobj) { struct loader *obj; DMUS_OBJECTDESC Desc; - struct cache_entry *dls; - struct list *pEntry; HRESULT hr; TRACE("(%s, %p)\n", debugstr_dmguid(lpcGUID), ppobj); @@ -895,16 +889,6 @@ HRESULT create_dmloader(REFIID lpcGUID, void **ppobj) DMUSIC_GetDefaultGMPath(Desc.wszFileName); IDirectMusicLoader_SetObject(&obj->IDirectMusicLoader8_iface, &Desc); - /* and now the workaroundTM for "invalid" default DLS; basically, - my tests showed that if GUID chunk is present in default DLS - collection, loader treats it as "invalid" and returns - DMUS_E_LOADER_NOFILENAME for all requests for it; basically, we check - if out input guidObject was overwritten */ - pEntry = list_head(&obj->cache); - dls = LIST_ENTRY(pEntry, struct cache_entry, entry); - if (!IsEqualGUID(&Desc.guidObject, &GUID_DefaultGMCollection)) - dls->bInvalidDefaultDLS = TRUE; - hr = IDirectMusicLoader_QueryInterface(&obj->IDirectMusicLoader8_iface, lpcGUID, ppobj); IDirectMusicLoader_Release(&obj->IDirectMusicLoader8_iface); return hr;
1
0
0
0
Rémi Bernon : dmusic/tests: Test default gm.dls sound font instruments.
by Alexandre Julliard
29 Sep '23
29 Sep '23
Module: wine Branch: master Commit: 767c5ddbf9bd2dc50442c5ba9e7eceffcd28c2fd URL:
https://gitlab.winehq.org/wine/wine/-/commit/767c5ddbf9bd2dc50442c5ba9e7ece…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Sep 20 10:32:33 2023 +0200 dmusic/tests: Test default gm.dls sound font instruments. --- dlls/dmusic/tests/dmusic.c | 300 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 300 insertions(+)
1
0
0
0
← Newer
1
2
3
4
5
6
...
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