winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2017
----- 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
2 participants
640 discussions
Start a n
N
ew thread
Sebastian Lackner : mfplat: Fix invalid memory access.
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: d7dcb965d56416f58f0ce3c441d7b8f9d5351ff9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d7dcb965d56416f58f0ce3c44…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Wed May 10 17:45:20 2017 +0200 mfplat: Fix invalid memory access. Introduced in 0e93b08f6e81799f943159e529c3fa1e767d0d02. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c index c1c7003..56bc284 100644 --- a/dlls/mfplat/main.c +++ b/dlls/mfplat/main.c @@ -262,7 +262,7 @@ static BOOL match_type(const WCHAR *clsid_str, const WCHAR *type_str, MFT_REGIST if (RegQueryValueExW(hfilter, type_str, NULL, ®_type, (LPBYTE)info, &size) != ERROR_SUCCESS) goto out; - for (i = 0; i < size / sizeof(MFT_REGISTER_TYPE_INFO) + 1; i++) + for (i = 0; i < size / sizeof(MFT_REGISTER_TYPE_INFO); i++) { if (IsEqualGUID(&info[i].guidMajorType, &type->guidMajorType) && IsEqualGUID(&info[i].guidSubtype, &type->guidSubtype))
1
0
0
0
Sebastian Lackner : psapi/tests: Remove todo_wine from succeeding tests.
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: e39d1614a9dad5f1b4aabcad7ec46c744c8370b0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e39d1614a9dad5f1b4aabcad7…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Wed May 10 17:38:51 2017 +0200 psapi/tests: Remove todo_wine from succeeding tests. These were missed in 19a79f422818859dd5a052ddc8e270ffbfef6e71. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/psapi/tests/psapi_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c index 7bc26fe..e35a7b6 100644 --- a/dlls/psapi/tests/psapi_main.c +++ b/dlls/psapi/tests/psapi_main.c @@ -303,9 +303,7 @@ static void test_GetProcessMemoryInfo(void) SetLastError(0xdeadbeef); ret = pGetProcessMemoryInfo(hpSR, &pmc, sizeof(pmc)); -todo_wine ok(!ret, "GetProcessMemoryInfo should fail\n"); -todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "expected error=ERROR_ACCESS_DENIED but got %d\n", GetLastError()); SetLastError(0xdeadbeef);
1
0
0
0
Józef Kucia : amstream: Fix compilation on systems that don't support nameless unions.
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: e8e23114a220bcb3c7966e5fba541a2b3823f0f7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8e23114a220bcb3c7966e5fb…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Wed May 10 16:20:52 2017 +0200 amstream: Fix compilation on systems that don't support nameless unions. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/amstream/mediastream.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/dlls/amstream/mediastream.c b/dlls/amstream/mediastream.c index 188ab88..53556af 100644 --- a/dlls/amstream/mediastream.c +++ b/dlls/amstream/mediastream.c @@ -18,16 +18,19 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "wine/debug.h" - +#define NONAMELESSUNION +#define NONAMELESSSTRUCT #define COBJMACROS +#include <stdarg.h> +#include "windef.h" #include "winbase.h" #include "wingdi.h" #include "amstream_private.h" #include "ddstream.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(amstream); @@ -1021,11 +1024,11 @@ static HRESULT ddrawstreamsample_create(IDirectDrawMediaStream *parent, IDirectD desc.dwWidth = 100; desc.ddpfPixelFormat.dwSize = sizeof(desc.ddpfPixelFormat); desc.ddpfPixelFormat.dwFlags = DDPF_RGB; - desc.ddpfPixelFormat.dwRGBBitCount = 32; - desc.ddpfPixelFormat.dwRBitMask = 0xff0000; - desc.ddpfPixelFormat.dwGBitMask = 0x00ff00; - desc.ddpfPixelFormat.dwBBitMask = 0x0000ff; - desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0; + desc.ddpfPixelFormat.u1.dwRGBBitCount = 32; + desc.ddpfPixelFormat.u2.dwRBitMask = 0xff0000; + desc.ddpfPixelFormat.u3.dwGBitMask = 0x00ff00; + desc.ddpfPixelFormat.u4.dwBBitMask = 0x0000ff; + desc.ddpfPixelFormat.u5.dwRGBAlphaBitMask = 0; desc.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN; desc.lpSurface = NULL;
1
0
0
0
Nikolay Sivov : dwrite: Fix compilation failure regarding nameless unions.
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: af54ed51b00db42be1adade1c8a2fb2dcf837edc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af54ed51b00db42be1adade1c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed May 10 17:16:10 2017 +0300 dwrite: Fix compilation failure regarding nameless unions. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/opentype.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index 5f2de23..a66500a 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -19,6 +19,7 @@ */ #define COBJMACROS +#define NONAMELESSUNION #include "dwrite_private.h" #include "winternl.h" @@ -1900,10 +1901,10 @@ HRESULT opentype_get_cpal_entries(const void *cpal, UINT32 palette, UINT32 first first_entry_index += GET_BE_WORD(header->colorRecordIndices[palette]); for (i = 0; i < entry_count; i++) { - entries[i].r = records[first_entry_index + i].red / 255.0f; - entries[i].g = records[first_entry_index + i].green / 255.0f; - entries[i].b = records[first_entry_index + i].blue / 255.0f; - entries[i].a = records[first_entry_index + i].alpha / 255.0f; + entries[i].u1.r = records[first_entry_index + i].red / 255.0f; + entries[i].u2.g = records[first_entry_index + i].green / 255.0f; + entries[i].u3.b = records[first_entry_index + i].blue / 255.0f; + entries[i].u4.a = records[first_entry_index + i].alpha / 255.0f; } return S_OK;
1
0
0
0
Michael Stefaniuc : dmusic: Add dsound handling to the synth port Activate () method.
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: 43b3f844baaf9e2ea82bc59066880e7aae70fc21 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=43b3f844baaf9e2ea82bc5906…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed May 10 14:44:03 2017 +0200 dmusic: Add dsound handling to the synth port Activate() method. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmusic/port.c | 24 +++++++++++++++++++++--- dlls/dmusic/tests/dmusic.c | 14 +++++++------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 1bff721..5f4d918 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -436,11 +436,29 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_GetNumChannelGroups(LPDIREC return S_OK; } -static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_Activate(LPDIRECTMUSICPORT iface, BOOL active) +static HRESULT WINAPI synth_dmport_Activate(IDirectMusicPort *iface, BOOL active) { SynthPortImpl *This = impl_from_SynthPortImpl_IDirectMusicPort(iface); - TRACE("(%p/%p)->(%d)\n", iface, This, active); + FIXME("(%p/%p)->(%d): semi-stub\n", iface, This, active); + + if (This->active == active) + return S_FALSE; + + if (active) { + /* Acquire the dsound */ + if (!This->dsound) { + IDirectSound_AddRef(This->parent->dsound); + This->dsound = This->parent->dsound; + } + IDirectSound_AddRef(This->dsound); + } else { + /* Release the dsound */ + IDirectSound_Release(This->dsound); + IDirectSound_Release(This->parent->dsound); + if (This->dsound == This->parent->dsound) + This->dsound = NULL; + } This->active = active; @@ -567,7 +585,7 @@ static const IDirectMusicPortVtbl SynthPortImpl_DirectMusicPort_Vtbl = { SynthPortImpl_IDirectMusicPort_DeviceIoControl, SynthPortImpl_IDirectMusicPort_SetNumChannelGroups, SynthPortImpl_IDirectMusicPort_GetNumChannelGroups, - SynthPortImpl_IDirectMusicPort_Activate, + synth_dmport_Activate, SynthPortImpl_IDirectMusicPort_SetChannelPriority, SynthPortImpl_IDirectMusicPort_GetChannelPriority, synth_dmport_SetDirectSound, diff --git a/dlls/dmusic/tests/dmusic.c b/dlls/dmusic/tests/dmusic.c index a96b4f7..f65dc7e 100644 --- a/dlls/dmusic/tests/dmusic.c +++ b/dlls/dmusic/tests/dmusic.c @@ -179,7 +179,7 @@ static void test_setdsound(void) hr = IDirectMusicPort_Activate(port, TRUE); ok(hr == S_OK, "Port Activate returned: %x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); + ok(ref == 4, "dsound ref count got %d expected 4\n", ref); /* Releasing dsound from dmusic */ hr = IDirectMusic_SetDirectSound(dmusic, NULL, NULL); @@ -231,13 +231,13 @@ static void test_setdsound(void) hr = IDirectMusicPort_Activate(port, TRUE); ok(hr == S_OK, "Activate returned: %x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); + ok(ref == 4, "dsound ref count got %d expected 4\n", ref); ref = get_refcount(dsound2); ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); hr = IDirectMusicPort_Activate(port, TRUE); - todo_wine ok(hr == S_FALSE, "Activate returned: %x\n", hr); + ok(hr == S_FALSE, "Activate returned: %x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); + ok(ref == 4, "dsound ref count got %d expected 4\n", ref); ref = get_refcount(dsound2); ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); @@ -247,13 +247,13 @@ static void test_setdsound(void) ref = get_refcount(dsound); ok(ref == 3, "dsound ref count got %d expected 3\n", ref); ref = get_refcount(dsound2); - todo_wine ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); + ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); hr = IDirectMusicPort_Activate(port, FALSE); - todo_wine ok(hr == S_FALSE, "Port Activate returned: %x\n", hr); + ok(hr == S_FALSE, "Port Activate returned: %x\n", hr); ref = get_refcount(dsound); ok(ref == 3, "dsound ref count got %d expected 3\n", ref); ref = get_refcount(dsound2); - todo_wine ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); + ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); IDirectMusicPort_Release(port); IDirectMusic_Release(dmusic);
1
0
0
0
Michael Stefaniuc : dmusic: Partially implement the synth IDirectMusicPort ::SetDirectSound().
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: f968edb988180cfdc986a838168588ed77f6edc6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f968edb988180cfdc986a8381…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed May 10 14:44:02 2017 +0200 dmusic: Partially implement the synth IDirectMusicPort::SetDirectSound(). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmusic/port.c | 41 ++++++++++++++++++++++++++++++++++------- dlls/dmusic/tests/dmusic.c | 18 +++++++++--------- 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 577fb0a..1bff721 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -31,11 +31,12 @@ typedef struct SynthPortImpl { IKsControl IKsControl_iface; LONG ref; IDirectMusic8Impl *parent; - IDirectSound *pDirectSound; + IDirectSound *dsound; + IDirectSoundBuffer *dsbuffer; IReferenceClock *pLatencyClock; IDirectMusicSynth *synth; IDirectMusicSynthSink *synth_sink; - BOOL fActive; + BOOL active; DMUS_PORTCAPS caps; DMUS_PORTPARAMS params; int nrofgroups; @@ -198,6 +199,10 @@ static ULONG WINAPI SynthPortImpl_IDirectMusicPort_Release(LPDIRECTMUSICPORT ifa IDirectMusicSynth_Release(This->synth); IDirectMusicSynthSink_Release(This->synth_sink); IReferenceClock_Release(This->pLatencyClock); + if (This->dsbuffer) + IDirectSoundBuffer_Release(This->dsbuffer); + if (This->dsound) + IDirectSound_Release(This->dsound); HeapFree(GetProcessHeap(), 0, This); } @@ -437,7 +442,7 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_Activate(LPDIRECTMUSICPORT TRACE("(%p/%p)->(%d)\n", iface, This, active); - This->fActive = active; + This->active = active; return S_OK; } @@ -468,11 +473,33 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_GetChannelPriority(LPDIRECT return S_OK; } -static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_SetDirectSound(LPDIRECTMUSICPORT iface, LPDIRECTSOUND direct_sound, LPDIRECTSOUNDBUFFER direct_sound_buffer) +static HRESULT WINAPI synth_dmport_SetDirectSound(IDirectMusicPort *iface, IDirectSound *dsound, + IDirectSoundBuffer *dsbuffer) { SynthPortImpl *This = impl_from_SynthPortImpl_IDirectMusicPort(iface); - FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, direct_sound, direct_sound_buffer); + FIXME("(%p/%p)->(%p, %p): semi-stub\n", iface, This, dsound, dsbuffer); + + if (This->active) + return DMUS_E_DSOUND_ALREADY_SET; + + if (This->dsound) { + if (This->dsound != This->parent->dsound) + ERR("Not the same dsound in the port (%p) and parent dmusic (%p), expect trouble!\n", + This->dsound, This->parent->dsound); + if (!IDirectSound_Release(This->parent->dsound)) + This->parent->dsound = NULL; + } + if (This->dsbuffer) + IDirectSound_Release(This->dsbuffer); + + This->dsound = dsound; + This->dsbuffer = dsbuffer; + + if (This->dsound) + IDirectSound_AddRef(This->dsound); + if (This->dsbuffer) + IDirectSound_AddRef(This->dsbuffer); return S_OK; } @@ -543,7 +570,7 @@ static const IDirectMusicPortVtbl SynthPortImpl_DirectMusicPort_Vtbl = { SynthPortImpl_IDirectMusicPort_Activate, SynthPortImpl_IDirectMusicPort_SetChannelPriority, SynthPortImpl_IDirectMusicPort_GetChannelPriority, - SynthPortImpl_IDirectMusicPort_SetDirectSound, + synth_dmport_SetDirectSound, SynthPortImpl_IDirectMusicPort_GetFormat }; @@ -785,7 +812,7 @@ HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_param obj->IKsControl_iface.lpVtbl = &ikscontrol_vtbl; obj->ref = 1; obj->parent = parent; - obj->fActive = FALSE; + obj->active = FALSE; obj->params = *port_params; obj->caps = *port_caps; diff --git a/dlls/dmusic/tests/dmusic.c b/dlls/dmusic/tests/dmusic.c index f701b2b..a96b4f7 100644 --- a/dlls/dmusic/tests/dmusic.c +++ b/dlls/dmusic/tests/dmusic.c @@ -183,11 +183,11 @@ static void test_setdsound(void) /* Releasing dsound from dmusic */ hr = IDirectMusic_SetDirectSound(dmusic, NULL, NULL); - todo_wine ok(hr == DMUS_E_DSOUND_ALREADY_SET, "SetDirectSound failed: %08x\n", hr); + ok(hr == DMUS_E_DSOUND_ALREADY_SET, "SetDirectSound failed: %08x\n", hr); hr = IDirectMusicPort_Activate(port, FALSE); ok(hr == S_OK, "Port Activate returned: %x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); hr = IDirectMusic_SetDirectSound(dmusic, NULL, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); @@ -217,41 +217,41 @@ static void test_setdsound(void) hr = IDirectMusicPort_SetDirectSound(port, dsound, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); ref = get_refcount(dsound2); ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); /* Setting the dsound again on the port will mess with the parent dmusic */ hr = IDirectMusicPort_SetDirectSound(port, dsound, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref); + ok(ref == 3, "dsound ref count got %d expected 3\n", ref); ref = get_refcount(dsound2); - todo_wine ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); + ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); IDirectSound_AddRef(dsound2); /* Crash prevention */ hr = IDirectMusicPort_Activate(port, TRUE); ok(hr == S_OK, "Activate returned: %x\n", hr); ref = get_refcount(dsound); todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); ref = get_refcount(dsound2); - todo_wine ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); hr = IDirectMusicPort_Activate(port, TRUE); todo_wine ok(hr == S_FALSE, "Activate returned: %x\n", hr); ref = get_refcount(dsound); todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); ref = get_refcount(dsound2); - todo_wine ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); /* Deactivating the port messes with the dsound refcount in the parent dmusic */ hr = IDirectMusicPort_Activate(port, FALSE); ok(hr == S_OK, "Port Activate returned: %x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref); + ok(ref == 3, "dsound ref count got %d expected 3\n", ref); ref = get_refcount(dsound2); todo_wine ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); hr = IDirectMusicPort_Activate(port, FALSE); todo_wine ok(hr == S_FALSE, "Port Activate returned: %x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref); + ok(ref == 3, "dsound ref count got %d expected 3\n", ref); ref = get_refcount(dsound2); todo_wine ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref);
1
0
0
0
Michael Stefaniuc : dmusic: Pass only the needed stuff to the DMPort create functions.
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: e8873b75afedcb10b4915ef9b2afa3f412dda851 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8873b75afedcb10b4915ef9b…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed May 10 14:44:01 2017 +0200 dmusic: Pass only the needed stuff to the DMPort create functions. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmusic/dmusic.c | 10 +++++----- dlls/dmusic/dmusic_private.h | 12 ++++++++---- dlls/dmusic/port.c | 30 +++++++++++++++++------------- 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index 5dcda64..d5d061c 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -153,7 +153,7 @@ static HRESULT WINAPI IDirectMusic8Impl_CreatePort(LPDIRECTMUSIC8 iface, REFCLSI for (i = 0; S_FALSE != IDirectMusic8Impl_EnumPort(iface, i, &port_caps); i++) { if (IsEqualCLSID(request_port, &port_caps.guidPort)) { - hr = This->system_ports[i].create(&IID_IDirectMusicPort, (LPVOID*)&new_port, (LPUNKNOWN)This, port_params, &port_caps, This->system_ports[i].device); + hr = This->system_ports[i].create(This, port_params, &port_caps, &new_port); if (FAILED(hr)) { *port = NULL; return hr; @@ -379,7 +379,7 @@ static void create_system_ports_list(IDirectMusic8Impl* object) /* Fill midi mapper port info */ port->device = MIDI_MAPPER; - port->create = DMUSIC_CreateMidiOutPortImpl; + port->create = midi_out_port_create; midiOutGetDevCapsW(MIDI_MAPPER, &caps_out, sizeof(caps_out)); strcpyW(port->caps.wszDescription, caps_out.szPname); strcatW(port->caps.wszDescription, emulated); @@ -391,7 +391,7 @@ static void create_system_ports_list(IDirectMusic8Impl* object) for (i = 0; i < nb_midi_out; i++) { port->device = i; - port->create = DMUSIC_CreateMidiOutPortImpl; + port->create = midi_out_port_create; midiOutGetDevCapsW(i, &caps_out, sizeof(caps_out)); strcpyW(port->caps.wszDescription, caps_out.szPname); strcatW(port->caps.wszDescription, emulated); @@ -404,7 +404,7 @@ static void create_system_ports_list(IDirectMusic8Impl* object) for (i = 0; i < nb_midi_in; i++) { port->device = i; - port->create = DMUSIC_CreateMidiInPortImpl; + port->create = midi_in_port_create; midiInGetDevCapsW(i, &caps_in, sizeof(caps_in)); strcpyW(port->caps.wszDescription, caps_in.szPname); strcatW(port->caps.wszDescription, emulated); @@ -414,7 +414,7 @@ static void create_system_ports_list(IDirectMusic8Impl* object) } /* Fill synth port info */ - port->create = DMUSIC_CreateSynthPortImpl; + port->create = synth_port_create; hr = CoCreateInstance(&CLSID_DirectMusicSynth, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusicSynth8, (void**)&synth); if (SUCCEEDED(hr)) { diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index a470989..053d24f 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -71,7 +71,8 @@ typedef struct DMUSIC_PRIVATE_CHANNEL_GROUP_ { typedef struct port_info { DMUS_PORTCAPS caps; - HRESULT (*create)(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device); + HRESULT (*create)(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, + DMUS_PORTCAPS *port_caps, IDirectMusicPort **port); ULONG device; } port_info; @@ -157,9 +158,12 @@ struct IDirectMusicDownloadImpl { }; /** Internal factory */ -extern HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device) DECLSPEC_HIDDEN; -extern HRESULT DMUSIC_CreateMidiOutPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device) DECLSPEC_HIDDEN; -extern HRESULT DMUSIC_CreateMidiInPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device) DECLSPEC_HIDDEN; +extern HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, + DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN; +extern HRESULT midi_out_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, + DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN; +extern HRESULT midi_in_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, + DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) DECLSPEC_HIDDEN; /***************************************************************************** * IReferenceClockImpl implementation structure diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 07da1ae..577fb0a 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -30,6 +30,7 @@ typedef struct SynthPortImpl { IDirectMusicThru IDirectMusicThru_iface; IKsControl IKsControl_iface; LONG ref; + IDirectMusic8Impl *parent; IDirectSound *pDirectSound; IReferenceClock *pLatencyClock; IDirectMusicSynth *synth; @@ -763,16 +764,16 @@ static const IKsControlVtbl ikscontrol_vtbl = { IKsControlImpl_KsEvent }; -HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device) +HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, + DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) { SynthPortImpl *obj; HRESULT hr = E_FAIL; int i; - TRACE("(%s, %p, %p, %p, %p, %d)\n", debugstr_guid(guid), object, unkouter, port_params, - port_caps, device); + TRACE("(%p, %p, %p)\n", port_params, port_caps, port); - *object = NULL; + *port = NULL; obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SynthPortImpl)); if (!obj) @@ -782,7 +783,8 @@ HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkou obj->IDirectMusicPortDownload_iface.lpVtbl = &SynthPortImpl_DirectMusicPortDownload_Vtbl; obj->IDirectMusicThru_iface.lpVtbl = &SynthPortImpl_DirectMusicThru_Vtbl; obj->IKsControl_iface.lpVtbl = &ikscontrol_vtbl; - obj->ref = 0; /* Will be inited by QueryInterface */ + obj->ref = 1; + obj->parent = parent; obj->fActive = FALSE; obj->params = *port_params; obj->caps = *port_caps; @@ -839,8 +841,10 @@ HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkou } } - if (SUCCEEDED(hr)) - return IDirectMusicPort_QueryInterface((LPDIRECTMUSICPORT)obj, guid, object); + if (SUCCEEDED(hr)) { + *port = &obj->IDirectMusicPort_iface; + return S_OK; + } if (obj->synth) IDirectMusicSynth_Release(obj->synth); @@ -853,18 +857,18 @@ HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkou return hr; } -HRESULT DMUSIC_CreateMidiOutPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device) +HRESULT midi_out_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, + DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) { - TRACE("(%s, %p, %p, %p, %p, %d): stub\n", debugstr_guid(guid), object, unkouter, port_params, - port_caps, device); + FIXME("(%p, %p, %p): stub\n", port_params, port_caps, port); return E_NOTIMPL; } -HRESULT DMUSIC_CreateMidiInPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkouter, LPDMUS_PORTPARAMS port_params, LPDMUS_PORTCAPS port_caps, DWORD device) +HRESULT midi_in_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, + DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) { - TRACE("(%s, %p, %p, %p, %p, %d): stub\n", debugstr_guid(guid), object, unkouter, port_params, - port_caps, device); + FIXME("(%p, %p, %p): stub\n", port_params, port_caps, port); return E_NOTIMPL; }
1
0
0
0
Michael Stefaniuc : dmusic: Implement IDirectMusic8::SetDirectSound().
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: 36a88d2841acd753a3197a045122152854f893e8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=36a88d2841acd753a3197a045…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed May 10 15:13:19 2017 +0200 dmusic: Implement IDirectMusic8::SetDirectSound(). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmime/tests/performance.c | 8 ++++---- dlls/dmusic/Makefile.in | 2 +- dlls/dmusic/dmusic.c | 33 +++++++++++++++++++++++++++++++-- dlls/dmusic/dmusic_private.h | 1 + dlls/dmusic/tests/dmusic.c | 18 +++++++++--------- 5 files changed, 46 insertions(+), 16 deletions(-) diff --git a/dlls/dmime/tests/performance.c b/dlls/dmime/tests/performance.c index 0932cd9..730ec52 100644 --- a/dlls/dmime/tests/performance.c +++ b/dlls/dmime/tests/performance.c @@ -169,11 +169,11 @@ static HRESULT test_InitAudio(void) IDirectMusic_SetDirectSound(dmusic, dsound, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); hr = IDirectMusicPerformance8_InitAudio(performance, &dmusic, NULL, NULL, 0, 64, 0, NULL); ok(hr == S_OK, "InitAudio failed: %08x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); ref = get_refcount(dmusic); ok(ref == 2, "dmusic ref count got %d expected 2\n", ref); destroy_performance(performance, dmusic, dsound); @@ -183,11 +183,11 @@ static HRESULT test_InitAudio(void) IDirectMusic_SetDirectSound(dmusic, dsound, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); hr = IDirectMusicPerformance8_InitAudio(performance, &dmusic, &dsound, NULL, 0, 64, 0, NULL); ok(hr == S_OK, "InitAudio failed: %08x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref); + ok(ref == 3, "dsound ref count got %d expected 3\n", ref); ref = get_refcount(dmusic); ok(ref == 2, "dmusic ref count got %d expected 2\n", ref); destroy_performance(performance, dmusic, dsound); diff --git a/dlls/dmusic/Makefile.in b/dlls/dmusic/Makefile.in index 98cfaef..a8955a2 100644 --- a/dlls/dmusic/Makefile.in +++ b/dlls/dmusic/Makefile.in @@ -1,5 +1,5 @@ MODULE = dmusic.dll -IMPORTS = dxguid uuid ole32 advapi32 winmm +IMPORTS = dxguid uuid ole32 advapi32 dsound user32 winmm C_SRCS = \ buffer.c \ diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index b1c0a19..5dcda64 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -73,6 +73,8 @@ static ULONG WINAPI IDirectMusic8Impl_Release(LPDIRECTMUSIC8 iface) if (!ref) { IReferenceClock_Release(&This->master_clock->IReferenceClock_iface); + if (This->dsound) + IDirectSound_Release(This->dsound); HeapFree(GetProcessHeap(), 0, This->system_ports); HeapFree(GetProcessHeap(), 0, This->ports); HeapFree(GetProcessHeap(), 0, This); @@ -271,11 +273,38 @@ static HRESULT WINAPI IDirectMusic8Impl_GetDefaultPort(LPDIRECTMUSIC8 iface, LPG return S_OK; } -static HRESULT WINAPI IDirectMusic8Impl_SetDirectSound(LPDIRECTMUSIC8 iface, LPDIRECTSOUND dsound, HWND wnd) +static HRESULT WINAPI IDirectMusic8Impl_SetDirectSound(IDirectMusic8 *iface, IDirectSound *dsound, + HWND hwnd) { IDirectMusic8Impl *This = impl_from_IDirectMusic8(iface); + HRESULT hr; + int i; + + TRACE("(%p)->(%p, %p)\n", This, dsound, hwnd); + + for (i = 0; i < This->num_ports; i++) + { + hr = IDirectMusicPort_SetDirectSound(This->ports[i], NULL, NULL); + if (FAILED(hr)) + return hr; + } + + if (This->dsound) + IDirectSound_Release(This->dsound); + + if (!dsound) { + hr = DirectSoundCreate8(NULL, (IDirectSound8 **)&This->dsound, NULL); + if (FAILED(hr)) + return hr; + hr = IDirectSound_SetCooperativeLevel(This->dsound, hwnd ? hwnd : GetForegroundWindow(), + DSSCL_PRIORITY); + if (FAILED(hr)) + IDirectSound_Release(This->dsound); + return hr; + } - FIXME("(%p)->(%p, %p): stub\n", This, dsound, wnd); + IDirectSound_AddRef(dsound); + This->dsound = dsound; return S_OK; } diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index 0819687..a470989 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -108,6 +108,7 @@ extern HRESULT DMUSIC_CreateDirectMusicInstrumentImpl (LPCGUID lpcGUID, LPVOID* struct IDirectMusic8Impl { IDirectMusic8 IDirectMusic8_iface; LONG ref; + IDirectSound *dsound; IReferenceClockImpl *master_clock; IDirectMusicPort **ports; int num_ports; diff --git a/dlls/dmusic/tests/dmusic.c b/dlls/dmusic/tests/dmusic.c index 1d1f948..f701b2b 100644 --- a/dlls/dmusic/tests/dmusic.c +++ b/dlls/dmusic/tests/dmusic.c @@ -171,11 +171,11 @@ static void test_setdsound(void) hr = IDirectMusic_SetDirectSound(dmusic, dsound, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); hr = IDirectMusic_CreatePort(dmusic, &GUID_NULL, ¶ms, &port, NULL); ok(hr == S_OK, "CreatePort returned: %x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); hr = IDirectMusicPort_Activate(port, TRUE); ok(hr == S_OK, "Port Activate returned: %x\n", hr); ref = get_refcount(dsound); @@ -197,11 +197,11 @@ static void test_setdsound(void) hr = IDirectMusic_SetDirectSound(dmusic, dsound, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); hr = IDirectMusic_SetDirectSound(dmusic, dsound, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); - todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound ref count got %d expected 2\n", ref); /* Replacing one dsound with another */ hr = DirectSoundCreate8(NULL, (IDirectSound8 **)&dsound2, NULL); @@ -211,7 +211,7 @@ static void test_setdsound(void) ref = get_refcount(dsound); ok(ref == 1, "dsound ref count got %d expected 1\n", ref); ref = get_refcount(dsound2); - todo_wine ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); /* Replacing the dsound in the port */ hr = IDirectMusicPort_SetDirectSound(port, dsound, NULL); @@ -219,27 +219,27 @@ static void test_setdsound(void) ref = get_refcount(dsound); todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); ref = get_refcount(dsound2); - todo_wine ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); /* Setting the dsound again on the port will mess with the parent dmusic */ hr = IDirectMusicPort_SetDirectSound(port, dsound, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref); ref = get_refcount(dsound2); - ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); + todo_wine ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); IDirectSound_AddRef(dsound2); /* Crash prevention */ hr = IDirectMusicPort_Activate(port, TRUE); ok(hr == S_OK, "Activate returned: %x\n", hr); ref = get_refcount(dsound); todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); ref = get_refcount(dsound2); - ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + todo_wine ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); hr = IDirectMusicPort_Activate(port, TRUE); todo_wine ok(hr == S_FALSE, "Activate returned: %x\n", hr); ref = get_refcount(dsound); todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); ref = get_refcount(dsound2); - ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + todo_wine ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); /* Deactivating the port messes with the dsound refcount in the parent dmusic */ hr = IDirectMusicPort_Activate(port, FALSE);
1
0
0
0
Michael Stefaniuc : dmusic: Use more sensible and consistent field names for IDirectMusic8Impl.
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: b75e8bc6bdfaaf22583e7e8af13e9c76666eefa1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b75e8bc6bdfaaf22583e7e8af…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed May 10 14:43:59 2017 +0200 dmusic: Use more sensible and consistent field names for IDirectMusic8Impl. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmusic/dmusic.c | 31 ++++++++++++++----------------- dlls/dmusic/dmusic_private.h | 13 +++++-------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index 5b01f0f..b1c0a19 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -72,9 +72,9 @@ static ULONG WINAPI IDirectMusic8Impl_Release(LPDIRECTMUSIC8 iface) TRACE("(%p)->(): new ref = %u\n", This, ref); if (!ref) { - IReferenceClock_Release(&This->pMasterClock->IReferenceClock_iface); + IReferenceClock_Release(&This->master_clock->IReferenceClock_iface); HeapFree(GetProcessHeap(), 0, This->system_ports); - HeapFree(GetProcessHeap(), 0, This->ppPorts); + HeapFree(GetProcessHeap(), 0, This->ports); HeapFree(GetProcessHeap(), 0, This); DMUSIC_UnlockModule(); } @@ -92,7 +92,7 @@ static HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD ind if (!port_caps) return E_POINTER; - if (index >= This->nb_system_ports) + if (index >= This->num_system_ports) return S_FALSE; *port_caps = This->system_ports[index].caps; @@ -156,12 +156,12 @@ static HRESULT WINAPI IDirectMusic8Impl_CreatePort(LPDIRECTMUSIC8 iface, REFCLSI *port = NULL; return hr; } - This->nrofports++; - if (!This->ppPorts) - This->ppPorts = HeapAlloc(GetProcessHeap(), 0, sizeof(LPDIRECTMUSICPORT) * This->nrofports); + This->num_ports++; + if (!This->ports) + This->ports = HeapAlloc(GetProcessHeap(), 0, sizeof(IDirectMusicPort *) * This->num_ports); else - This->ppPorts = HeapReAlloc(GetProcessHeap(), 0, This->ppPorts, sizeof(LPDIRECTMUSICPORT) * This->nrofports); - This->ppPorts[This->nrofports - 1] = new_port; + This->ports = HeapReAlloc(GetProcessHeap(), 0, This->ports, sizeof(IDirectMusicPort *) * This->num_ports); + This->ports[This->num_ports - 1] = new_port; *port = new_port; return S_OK; } @@ -209,9 +209,9 @@ static HRESULT WINAPI IDirectMusic8Impl_GetMasterClock(LPDIRECTMUSIC8 iface, LPG TRACE("(%p)->(%p, %p)\n", This, guid_clock, reference_clock); if (guid_clock) - *guid_clock = This->pMasterClock->pClockInfo.guidClock; + *guid_clock = This->master_clock->pClockInfo.guidClock; if (reference_clock) { - *reference_clock = &This->pMasterClock->IReferenceClock_iface; + *reference_clock = &This->master_clock->IReferenceClock_iface; IReferenceClock_AddRef(*reference_clock); } @@ -235,9 +235,9 @@ static HRESULT WINAPI IDirectMusic8Impl_Activate(LPDIRECTMUSIC8 iface, BOOL enab TRACE("(%p)->(%u)\n", This, enable); - for (i = 0; i < This->nrofports; i++) + for (i = 0; i < This->num_ports; i++) { - hr = IDirectMusicPort_Activate(This->ppPorts[i], enable); + hr = IDirectMusicPort_Activate(This->ports[i], enable); if (FAILED(hr)) return hr; } @@ -396,7 +396,7 @@ static void create_system_ports_list(IDirectMusic8Impl* object) if (FAILED(hr)) nb_ports--; - object->nb_system_ports = nb_ports; + object->num_system_ports = nb_ports; } /* For ClassFactory */ @@ -417,10 +417,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicImpl(LPCGUID riid, LPVOID* ret_iface, LPU dmusic->IDirectMusic8_iface.lpVtbl = &DirectMusic8_Vtbl; dmusic->ref = 1; - dmusic->pMasterClock = NULL; - dmusic->ppPorts = NULL; - dmusic->nrofports = 0; - ret = DMUSIC_CreateReferenceClockImpl(&IID_IReferenceClock, (LPVOID*)&dmusic->pMasterClock, NULL); + ret = DMUSIC_CreateReferenceClockImpl(&IID_IReferenceClock, (void **)&dmusic->master_clock, NULL); if (FAILED(ret)) { HeapFree(GetProcessHeap(), 0, dmusic); return ret; diff --git a/dlls/dmusic/dmusic_private.h b/dlls/dmusic/dmusic_private.h index cfe03fc..0819687 100644 --- a/dlls/dmusic/dmusic_private.h +++ b/dlls/dmusic/dmusic_private.h @@ -106,16 +106,13 @@ extern HRESULT DMUSIC_CreateDirectMusicInstrumentImpl (LPCGUID lpcGUID, LPVOID* * IDirectMusic8Impl implementation structure */ struct IDirectMusic8Impl { - /* IUnknown fields */ IDirectMusic8 IDirectMusic8_iface; LONG ref; - - /* IDirectMusicImpl fields */ - IReferenceClockImpl* pMasterClock; - IDirectMusicPort** ppPorts; - int nrofports; - port_info* system_ports; - int nb_system_ports; + IReferenceClockImpl *master_clock; + IDirectMusicPort **ports; + int num_ports; + port_info *system_ports; + int num_system_ports; }; /*****************************************************************************
1
0
0
0
Michael Stefaniuc : dmusic/tests: Expand the dsound refcount testing with the port.
by Alexandre Julliard
10 May '17
10 May '17
Module: wine Branch: master Commit: 251d1c0b86c8b26602f97e0ac6a7ee5bcf67f8ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=251d1c0b86c8b26602f97e0ac…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed May 10 14:43:58 2017 +0200 dmusic/tests: Expand the dsound refcount testing with the port. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmusic/tests/dmusic.c | 70 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 2 deletions(-) diff --git a/dlls/dmusic/tests/dmusic.c b/dlls/dmusic/tests/dmusic.c index 8473a40..1d1f948 100644 --- a/dlls/dmusic/tests/dmusic.c +++ b/dlls/dmusic/tests/dmusic.c @@ -132,9 +132,16 @@ static void test_setdsound(void) { IDirectMusic *dmusic; IDirectSound *dsound, *dsound2; + DMUS_PORTPARAMS params; + IDirectMusicPort *port = NULL; HRESULT hr; ULONG ref; + params.dwSize = sizeof(params); + params.dwValidParams = DMUS_PORTPARAMS_CHANNELGROUPS | DMUS_PORTPARAMS_AUDIOCHANNELS; + params.dwChannelGroups = 1; + params.dwAudioChannels = 2; + /* Old dsound without SetCooperativeLevel() */ hr = DirectSoundCreate(NULL, &dsound, NULL); if (hr == DSERR_NODRIVER ) { @@ -147,6 +154,9 @@ static void test_setdsound(void) ok(hr == S_OK, "DirectMusic create failed: %08x\n", hr); hr = IDirectMusic_SetDirectSound(dmusic, dsound, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); + hr = IDirectMusic_CreatePort(dmusic, &GUID_NULL, ¶ms, &port, NULL); + ok(hr == S_OK, "CreatePort returned: %x\n", hr); + IDirectMusicPort_Release(port); IDirectMusic_Release(dmusic); IDirectSound_Release(dsound); @@ -162,9 +172,23 @@ static void test_setdsound(void) ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + hr = IDirectMusic_CreatePort(dmusic, &GUID_NULL, ¶ms, &port, NULL); + ok(hr == S_OK, "CreatePort returned: %x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + hr = IDirectMusicPort_Activate(port, TRUE); + ok(hr == S_OK, "Port Activate returned: %x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); /* Releasing dsound from dmusic */ hr = IDirectMusic_SetDirectSound(dmusic, NULL, NULL); + todo_wine ok(hr == DMUS_E_DSOUND_ALREADY_SET, "SetDirectSound failed: %08x\n", hr); + hr = IDirectMusicPort_Activate(port, FALSE); + ok(hr == S_OK, "Port Activate returned: %x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + hr = IDirectMusic_SetDirectSound(dmusic, NULL, NULL); ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); ref = get_refcount(dsound); ok(ref == 1, "dsound ref count got %d expected 1\n", ref); @@ -189,9 +213,51 @@ static void test_setdsound(void) ref = get_refcount(dsound2); todo_wine ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + /* Replacing the dsound in the port */ + hr = IDirectMusicPort_SetDirectSound(port, dsound, NULL); + ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 2, "dsound ref count got %d expected 2\n", ref); + ref = get_refcount(dsound2); + todo_wine ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + /* Setting the dsound again on the port will mess with the parent dmusic */ + hr = IDirectMusicPort_SetDirectSound(port, dsound, NULL); + ok(hr == S_OK, "SetDirectSound failed: %08x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref); + ref = get_refcount(dsound2); + ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); + IDirectSound_AddRef(dsound2); /* Crash prevention */ + hr = IDirectMusicPort_Activate(port, TRUE); + ok(hr == S_OK, "Activate returned: %x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); + ref = get_refcount(dsound2); + ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + hr = IDirectMusicPort_Activate(port, TRUE); + todo_wine ok(hr == S_FALSE, "Activate returned: %x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 4, "dsound ref count got %d expected 4\n", ref); + ref = get_refcount(dsound2); + ok(ref == 2, "dsound2 ref count got %d expected 2\n", ref); + + /* Deactivating the port messes with the dsound refcount in the parent dmusic */ + hr = IDirectMusicPort_Activate(port, FALSE); + ok(hr == S_OK, "Port Activate returned: %x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref); + ref = get_refcount(dsound2); + todo_wine ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); + hr = IDirectMusicPort_Activate(port, FALSE); + todo_wine ok(hr == S_FALSE, "Port Activate returned: %x\n", hr); + ref = get_refcount(dsound); + todo_wine ok(ref == 3, "dsound ref count got %d expected 3\n", ref); + ref = get_refcount(dsound2); + todo_wine ok(ref == 1, "dsound2 ref count got %d expected 1\n", ref); + + IDirectMusicPort_Release(port); IDirectMusic_Release(dmusic); - IDirectSound_Release(dsound); - IDirectSound_Release(dsound2); + while (IDirectSound_Release(dsound)); } static void test_dmbuffer(void)
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
64
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
Results per page:
10
25
50
100
200