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
Alex Henrie : wintrust: Use CRT allocation functions.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: 6db69d0281543a240e1dd5ec0b0b7d841dc8f4cf URL:
https://gitlab.winehq.org/wine/wine/-/commit/6db69d0281543a240e1dd5ec0b0b7d…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Sep 7 18:16:22 2023 -0600 wintrust: Use CRT allocation functions. --- dlls/wintrust/crypt.c | 121 +++++++++++++++++++++--------------------- dlls/wintrust/register.c | 48 +++++++++-------- dlls/wintrust/softpub.c | 4 +- dlls/wintrust/wintrust_main.c | 110 +++++++++++--------------------------- dlls/wintrust/wintrust_priv.h | 3 -- 5 files changed, 121 insertions(+), 165 deletions(-)
1
0
0
0
Alex Henrie : wintab32: Use CRT allocation functions.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: 537bcadbe8e8254b27a95641dd677d6d26841021 URL:
https://gitlab.winehq.org/wine/wine/-/commit/537bcadbe8e8254b27a95641dd677d…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Thu Sep 7 17:36:12 2023 -0600 wintab32: Use CRT allocation functions. --- dlls/wintab32/context.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/wintab32/context.c b/dlls/wintab32/context.c index 58ba6b49074..b432e902a09 100644 --- a/dlls/wintab32/context.c +++ b/dlls/wintab32/context.c @@ -423,10 +423,10 @@ static UINT WTInfoT(UINT wCategory, UINT nIndex, LPVOID lpOutput, BOOL bUnicode) else if (is_string_field(wCategory, nIndex) && !bUnicode) { int size = pWTInfoW(wCategory, nIndex, NULL); - WCHAR *buf = HeapAlloc(GetProcessHeap(), 0, size); + WCHAR *buf = malloc(size); pWTInfoW(wCategory, nIndex, buf); result = WideCharToMultiByte(CP_ACP, 0, buf, size/sizeof(WCHAR), lpOutput, lpOutput ? 2*size : 0, NULL, NULL); - HeapFree(GetProcessHeap(), 0, buf); + free(buf); } else result = pWTInfoW(wCategory, nIndex, lpOutput); @@ -464,13 +464,13 @@ HCTX WINAPI WTOpenW(HWND hWnd, LPLOGCONTEXTW lpLogCtx, BOOL fEnable) TRACE("hWnd=%p, lpLogCtx=%p, fEnable=%u\n", hWnd, lpLogCtx, fEnable); DUMPCONTEXT(*lpLogCtx); - newcontext = HeapAlloc(GetProcessHeap(), 0 , sizeof(OPENCONTEXT)); + newcontext = malloc(sizeof(OPENCONTEXT)); newcontext->context = *lpLogCtx; newcontext->hwndOwner = hWnd; newcontext->ActiveCursor = -1; newcontext->QueueSize = 10; newcontext->PacketsQueued = 0; - newcontext->PacketQueue=HeapAlloc(GetProcessHeap(),0,sizeof(WTPACKET)*10); + newcontext->PacketQueue = malloc(sizeof(WTPACKET) * 10); EnterCriticalSection(&csTablet); newcontext->handle = gTopContext++; @@ -547,8 +547,8 @@ BOOL WINAPI WTClose(HCTX hCtx) TABLET_PostTabletMessage(context, _WT_CTXCLOSE(context->context.lcMsgBase), (WPARAM)context->handle, context->context.lcStatus,TRUE); - HeapFree(GetProcessHeap(),0,context->PacketQueue); - HeapFree(GetProcessHeap(),0,context); + free(context->PacketQueue); + free(context); return TRUE; } @@ -1124,8 +1124,7 @@ BOOL WINAPI WTQueueSizeSet(HCTX hCtx, int nPkts) return FALSE; } - context->PacketQueue = HeapReAlloc(GetProcessHeap(), 0, - context->PacketQueue, sizeof(WTPACKET)*nPkts); + context->PacketQueue = realloc(context->PacketQueue, sizeof(WTPACKET) * nPkts); context->QueueSize = nPkts; LeaveCriticalSection(&csTablet);
1
0
0
0
Helix Graziani : wldp: Add WldpQueryWindowsLockdownMode stub.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: 6dae924d554308e62a9b6d7520cbdf2058efa19a URL:
https://gitlab.winehq.org/wine/wine/-/commit/6dae924d554308e62a9b6d7520cbdf…
Author: Helix Graziani <helix.graziani(a)hotmail.com> Date: Mon Sep 4 10:44:35 2023 -0400 wldp: Add WldpQueryWindowsLockdownMode stub. --- dlls/wldp/wldp.c | 11 +++++++++++ dlls/wldp/wldp.spec | 2 +- include/wldp.h | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dlls/wldp/wldp.c b/dlls/wldp/wldp.c index ffd9b6084c7..0c2fd0c4b70 100644 --- a/dlls/wldp/wldp.c +++ b/dlls/wldp/wldp.c @@ -49,3 +49,14 @@ HRESULT WINAPI WldpGetLockdownPolicy(WLDP_HOST_INFORMATION *info, DWORD *state, *state = 0; return S_OK; } + +/*********************************************************************** + * WldpQueryWindowsLockdownMode (wldp.@) + */ +HRESULT WINAPI WldpQueryWindowsLockdownMode(WLDP_WINDOWS_LOCKDOWN_MODE *lockdown_mode) +{ + FIXME("%p\n", lockdown_mode); + + *lockdown_mode = WLDP_WINDOWS_LOCKDOWN_MODE_UNLOCKED; + return S_OK; +} diff --git a/dlls/wldp/wldp.spec b/dlls/wldp/wldp.spec index 7e5de1d372d..5e18c267d6c 100644 --- a/dlls/wldp/wldp.spec +++ b/dlls/wldp/wldp.spec @@ -4,7 +4,7 @@ @ stub WldpQueryPolicySettingEnabled2 @ stub WldpQueryPolicySettingEnabled @ stub WldpQueryPolicySettingEnabledInternal -@ stub WldpQueryWindowsLockdownMode +@ stdcall WldpQueryWindowsLockdownMode(ptr) @ stub WldpQueryWindowsLockdownRestriction @ stub WldpResetProductionConfiguration @ stub WldpResetWcosProductionConfiguration diff --git a/include/wldp.h b/include/wldp.h index c70e5feb8f8..93f246fffa4 100644 --- a/include/wldp.h +++ b/include/wldp.h @@ -32,6 +32,14 @@ typedef enum WLDP_HOST_ID WLDP_HOST_ID_MAX } WLDP_HOST_ID; +typedef enum _WLDP_WINDOWS_LOCKDOWN_MODE +{ + WLDP_WINDOWS_LOCKDOWN_MODE_UNLOCKED, + WLDP_WINDOWS_LOCKDOWN_MODE_TRIAL, + WLDP_WINDOWS_LOCKDOWN_MODE_LOCKED, + WLDP_WINDOWS_LOCKDOWN_MODE_MAX +} WLDP_WINDOWS_LOCKDOWN_MODE, *PWLDP_WINDOWS_LOCKDOWN_MODE; + typedef struct WLDP_HOST_INFORMATION { DWORD dwRevision;
1
0
0
0
Rémi Bernon : dmime/tests: Test IDirectMusicTool message reception delay.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: 5e68fa63944fbea2943de9aa651fb319eac8e613 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5e68fa63944fbea2943de9aa651fb3…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 7 10:21:31 2023 +0200 dmime/tests: Test IDirectMusicTool message reception delay. --- dlls/dmime/tests/dmime.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index a259ea599b8..f00b5073b48 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -1733,6 +1733,7 @@ static void test_performance_time(void) static void test_performance_pmsg(void) { + static const DWORD delivery_flags[] = {DMUS_PMSGF_TOOL_IMMEDIATE, DMUS_PMSGF_TOOL_QUEUE, DMUS_PMSGF_TOOL_ATTIME}; static const DWORD message_types[] = {DMUS_PMSGT_MIDI, DMUS_PMSGT_USER}; IDirectMusicPerformance *performance; IDirectMusicGraph *graph; @@ -1741,6 +1742,7 @@ static void test_performance_pmsg(void) REFERENCE_TIME time; HRESULT hr; DWORD ret; + UINT i; hr = test_tool_create(message_types, ARRAY_SIZE(message_types), &tool); ok(hr == S_OK, "got %#lx\n", hr); @@ -1890,6 +1892,50 @@ static void test_performance_pmsg(void) ok(hr == S_OK, "got %#lx\n", hr); + for (i = 0; i < ARRAY_SIZE(delivery_flags); i++) + { + DWORD duration = 0; + + hr = IDirectMusicPerformance_GetTime(performance, &time, NULL); + ok(hr == S_OK, "got %#lx\n", hr); + hr = IDirectMusicPerformance_AllocPMsg(performance, sizeof(DMUS_PMSG), &msg); + ok(hr == S_OK, "got %#lx\n", hr); + ok(msg->dwSize == sizeof(DMUS_PMSG), "got %ld\n", msg->dwSize); + msg->rtTime = time + 150 * 10000; + msg->dwFlags = DMUS_PMSGF_REFTIME; + msg->dwType = DMUS_PMSGT_USER; + + hr = IDirectMusicPerformance_QueryInterface(performance, &IID_IDirectMusicGraph, (void **)&graph); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + if (!graph) hr = S_OK; + else hr = IDirectMusicGraph_StampPMsg(graph, msg); + ok(hr == S_OK, "got %#lx\n", hr); + if (graph) IDirectMusicGraph_Release(graph); + + msg->dwFlags &= ~(DMUS_PMSGF_TOOL_IMMEDIATE | DMUS_PMSGF_TOOL_QUEUE | DMUS_PMSGF_TOOL_ATTIME); + msg->dwFlags |= delivery_flags[i]; + + duration -= GetTickCount(); + hr = IDirectMusicPerformance_SendPMsg(performance, msg); + ok(hr == S_OK, "got %#lx\n", hr); + msg = NULL; + ret = test_tool_wait_message(tool, 1000, &msg); + todo_wine ok(!ret, "got %#lx\n", ret); + todo_wine ok(msg != NULL, "got %p\n", msg); + duration += GetTickCount(); + + if (msg) hr = IDirectMusicPerformance_FreePMsg(performance, msg); + ok(hr == S_OK, "got %#lx\n", hr); + + switch (delivery_flags[i]) + { + case DMUS_PMSGF_TOOL_IMMEDIATE: todo_wine ok(duration <= 50, "got %lu\n", duration); break; + case DMUS_PMSGF_TOOL_QUEUE: todo_wine ok(duration >= 50 && duration <= 100, "got %lu\n", duration); break; + case DMUS_PMSGF_TOOL_ATTIME: todo_wine ok(duration >= 150 && duration <= 500, "got %lu\n", duration); break; + } + } + + hr = IDirectMusicPerformance_CloseDown(performance); ok(hr == S_OK, "got %#lx\n", hr);
1
0
0
0
Rémi Bernon : dmime/tests: Test IDirectMusicTool message reception filter.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: 2ac84e2b94342618bcffb4ab7ba6ec5ee5703f24 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2ac84e2b94342618bcffb4ab7ba6ec…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 5 18:37:02 2023 +0200 dmime/tests: Test IDirectMusicTool message reception filter. --- dlls/dmime/tests/dmime.c | 99 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 91 insertions(+), 8 deletions(-) diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 46751339994..a259ea599b8 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -61,6 +61,11 @@ struct test_tool LONG ref; IDirectMusicGraph *graph; + const DWORD *types; + DWORD types_count; + + HANDLE message_event; + DMUS_PMSG *message; }; static struct test_tool *impl_from_IDirectMusicTool(IDirectMusicTool *iface) @@ -98,6 +103,8 @@ static ULONG WINAPI test_tool_Release(IDirectMusicTool *iface) if (!ref) { if (tool->graph) IDirectMusicGraph_Release(tool->graph); + ok(!tool->message, "got %p\n", tool->message); + CloseHandle(tool->message_event); free(tool); } @@ -119,19 +126,35 @@ static HRESULT WINAPI test_tool_GetMsgDeliveryType(IDirectMusicTool *iface, DWOR static HRESULT WINAPI test_tool_GetMediaTypeArraySize(IDirectMusicTool *iface, DWORD *size) { - *size = 0; + struct test_tool *tool = impl_from_IDirectMusicTool(iface); + *size = tool->types_count; return S_OK; } static HRESULT WINAPI test_tool_GetMediaTypes(IDirectMusicTool *iface, DWORD **types, DWORD size) { - ok(0, "%#04lx: unexpected %s, types %p, size %lu\n", GetCurrentThreadId(), __func__, types, size); + struct test_tool *tool = impl_from_IDirectMusicTool(iface); + UINT i; + for (i = 0; i < tool->types_count; i++) (*types)[i] = tool->types[i]; return S_OK; } static HRESULT WINAPI test_tool_ProcessPMsg(IDirectMusicTool *iface, IDirectMusicPerformance *performance, DMUS_PMSG *msg) { - ok(0, "%#04lx: unexpected %s, iface %p, performance %p, msg %p\n", GetCurrentThreadId(), __func__, iface, performance, msg); + struct test_tool *tool = impl_from_IDirectMusicTool(iface); + DMUS_PMSG *clone; + HRESULT hr; + + hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, msg, &clone); + ok(hr == S_OK, "got %#lx\n", hr); + + clone = InterlockedExchangePointer((void **)&tool->message, clone); + ok(!clone, "got %p\n", clone); + SetEvent(tool->message_event); + + hr = IDirectMusicGraph_StampPMsg(msg->pGraph, msg); + ok(hr == S_OK, "got %#lx\n", hr); + return DMUS_S_REQUEUE; } @@ -155,7 +178,8 @@ static IDirectMusicToolVtbl test_tool_vtbl = test_tool_Flush, }; -static HRESULT test_tool_create(IDirectMusicTool **ret_iface) +static HRESULT test_tool_create(const DWORD *types, DWORD types_count, + IDirectMusicTool **ret_iface) { struct test_tool *tool; @@ -164,6 +188,11 @@ static HRESULT test_tool_create(IDirectMusicTool **ret_iface) tool->IDirectMusicTool_iface.lpVtbl = &test_tool_vtbl; tool->ref = 1; + tool->types = types; + tool->types_count = types_count; + tool->message_event = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(!!tool->message_event, "CreateEventW failed, error %lu\n", GetLastError()); + *ret_iface = &tool->IDirectMusicTool_iface; return S_OK; } @@ -175,6 +204,17 @@ static HRESULT test_tool_get_graph(IDirectMusicTool *iface, IDirectMusicGraph ** return tool->graph ? S_OK : DMUS_E_NOT_FOUND; } +static DWORD test_tool_wait_message(IDirectMusicTool *iface, DWORD timeout, DMUS_PMSG **msg) +{ + struct test_tool *tool = impl_from_IDirectMusicTool(iface); + DWORD ret; + + ret = WaitForSingleObject(tool->message_event, timeout); + *msg = InterlockedExchangePointer((void **)&tool->message, NULL); + + return ret; +} + static BOOL missing_dmime(void) { IDirectMusicSegment8 *dms; @@ -638,10 +678,10 @@ static void test_graph(void) IDirectMusicGraph_Release(graph); - hr = test_tool_create(&tool1); + hr = test_tool_create(NULL, 0, &tool1); ok(hr == S_OK, "got %#lx\n", hr); trace("created tool1 %p\n", tool1); - hr = test_tool_create(&tool2); + hr = test_tool_create(NULL, 0, &tool2); ok(hr == S_OK, "got %#lx\n", hr); trace("created tool2 %p\n", tool2); @@ -1486,7 +1526,7 @@ static void test_performance_graph(void) DMUS_PMSG msg; HRESULT hr; - hr = test_tool_create(&tool); + hr = test_tool_create(NULL, 0, &tool); ok(hr == S_OK, "got %#lx\n", hr); hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, @@ -1693,14 +1733,16 @@ static void test_performance_time(void) static void test_performance_pmsg(void) { + static const DWORD message_types[] = {DMUS_PMSGT_MIDI, DMUS_PMSGT_USER}; IDirectMusicPerformance *performance; IDirectMusicGraph *graph; IDirectMusicTool *tool; DMUS_PMSG *msg, *clone; REFERENCE_TIME time; HRESULT hr; + DWORD ret; - hr = test_tool_create(&tool); + hr = test_tool_create(message_types, ARRAY_SIZE(message_types), &tool); ok(hr == S_OK, "got %#lx\n", hr); hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, @@ -1807,6 +1849,47 @@ static void test_performance_pmsg(void) ok(!msg->punkUser, "got %p\n", msg->punkUser); + /* SendPMsg skips all the tools unless messages are stamped beforehand */ + + hr = IDirectMusicPerformance_AllocPMsg(performance, sizeof(DMUS_PMSG), &msg); + ok(hr == S_OK, "got %#lx\n", hr); + ok(msg->dwSize == sizeof(DMUS_PMSG), "got %ld\n", msg->dwSize); + msg->rtTime = time; + msg->dwFlags = DMUS_PMSGF_REFTIME; + msg->dwType = DMUS_PMSGT_USER; + hr = IDirectMusicPerformance_SendPMsg(performance, msg); + ok(hr == S_OK, "got %#lx\n", hr); + + ret = test_tool_wait_message(tool, 10, &msg); + ok(ret == WAIT_TIMEOUT, "got %#lx\n", ret); + ok(!msg, "got %p\n", msg); + + + hr = IDirectMusicPerformance_AllocPMsg(performance, sizeof(DMUS_PMSG), &msg); + ok(hr == S_OK, "got %#lx\n", hr); + ok(msg->dwSize == sizeof(DMUS_PMSG), "got %ld\n", msg->dwSize); + msg->rtTime = time; + msg->dwFlags = DMUS_PMSGF_REFTIME; + msg->dwType = DMUS_PMSGT_USER; + + graph = NULL; + hr = IDirectMusicPerformance_QueryInterface(performance, &IID_IDirectMusicGraph, (void **)&graph); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + if (graph) hr = IDirectMusicGraph_StampPMsg(graph, msg); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + if (graph) IDirectMusicGraph_Release(graph); + + hr = IDirectMusicPerformance_SendPMsg(performance, msg); + ok(hr == S_OK, "got %#lx\n", hr); + + ret = test_tool_wait_message(tool, 50, &msg); + todo_wine ok(!ret, "got %#lx\n", ret); + todo_wine ok(msg != NULL, "got %p\n", msg); + if (!msg) hr = S_OK; + else hr = IDirectMusicPerformance_FreePMsg(performance, msg); + ok(hr == S_OK, "got %#lx\n", hr); + + hr = IDirectMusicPerformance_CloseDown(performance); ok(hr == S_OK, "got %#lx\n", hr);
1
0
0
0
Rémi Bernon : dmime/tests: Test IDirectMusicPerformance_*PMsg methods.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: e80c1d90f1c08c1d2ec2a84949d69ca3219b3d1d URL:
https://gitlab.winehq.org/wine/wine/-/commit/e80c1d90f1c08c1d2ec2a84949d69c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 5 16:27:41 2023 +0200 dmime/tests: Test IDirectMusicPerformance_*PMsg methods. --- dlls/dmime/tests/dmime.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 7fa832ebfd5..46751339994 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -1691,6 +1691,129 @@ static void test_performance_time(void) } +static void test_performance_pmsg(void) +{ + IDirectMusicPerformance *performance; + IDirectMusicGraph *graph; + IDirectMusicTool *tool; + DMUS_PMSG *msg, *clone; + REFERENCE_TIME time; + HRESULT hr; + + hr = test_tool_create(&tool); + ok(hr == S_OK, "got %#lx\n", hr); + + hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicPerformance, (void **)&performance); + ok(hr == S_OK, "got %#lx\n", hr); + + + hr = IDirectMusicPerformance_AllocPMsg(performance, 0, NULL); + todo_wine ok(hr == E_POINTER, "got %#lx\n", hr); + hr = IDirectMusicPerformance_AllocPMsg(performance, sizeof(DMUS_PMSG) - 1, &msg); + ok(hr == E_INVALIDARG, "got %#lx\n", hr); + + hr = IDirectMusicPerformance_AllocPMsg(performance, sizeof(DMUS_PMSG), &msg); + ok(hr == S_OK, "got %#lx\n", hr); + ok(msg->dwSize == sizeof(DMUS_PMSG), "got %ld\n", msg->dwSize); + ok(!msg->rtTime, "got %I64d\n", msg->rtTime); + ok(!msg->mtTime, "got %ld\n", msg->mtTime); + ok(!msg->dwFlags, "got %#lx\n", msg->dwFlags); + ok(!msg->dwPChannel, "got %ld\n", msg->dwPChannel); + ok(!msg->dwVirtualTrackID, "got %ld\n", msg->dwVirtualTrackID); + ok(!msg->dwType, "got %#lx\n", msg->dwType); + ok(!msg->dwVoiceID, "got %ld\n", msg->dwVoiceID); + ok(!msg->dwGroupID, "got %ld\n", msg->dwGroupID); + ok(!msg->punkUser, "got %p\n", msg->punkUser); + + hr = IDirectMusicPerformance_SendPMsg(performance, NULL); + ok(hr == E_POINTER, "got %#lx\n", hr); + hr = IDirectMusicPerformance_SendPMsg(performance, msg); + todo_wine ok(hr == DMUS_E_NO_MASTER_CLOCK, "got %#lx\n", hr); + + hr = IDirectMusicPerformance_FreePMsg(performance, NULL); + ok(hr == E_POINTER, "got %#lx\n", hr); + hr = IDirectMusicPerformance_FreePMsg(performance, msg); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + + + hr = IDirectMusicPerformance_Init(performance, NULL, 0, 0); + ok(hr == S_OK, "got %#lx\n", hr); + + hr = CoCreateInstance(&CLSID_DirectMusicGraph, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicGraph, (void **)&graph); + ok(hr == S_OK, "got %#lx\n", hr); + hr = IDirectMusicPerformance_SetGraph(performance, graph); + ok(hr == S_OK, "got %#lx\n", hr); + hr = IDirectMusicGraph_InsertTool(graph, (IDirectMusicTool *)tool, NULL, 0, -1); + ok(hr == S_OK, "got %#lx\n", hr); + IDirectMusicGraph_Release(graph); + + hr = IDirectMusicPerformance_AllocPMsg(performance, sizeof(DMUS_PMSG), &msg); + ok(hr == S_OK, "got %#lx\n", hr); + ok(msg->dwSize == sizeof(DMUS_PMSG), "got %ld\n", msg->dwSize); + ok(!msg->rtTime, "got %I64d\n", msg->rtTime); + ok(!msg->mtTime, "got %ld\n", msg->mtTime); + ok(!msg->dwFlags, "got %#lx\n", msg->dwFlags); + ok(!msg->dwPChannel, "got %ld\n", msg->dwPChannel); + ok(!msg->dwVirtualTrackID, "got %ld\n", msg->dwVirtualTrackID); + ok(!msg->pTool, "got %p\n", msg->pTool); + ok(!msg->pGraph, "got %p\n", msg->pGraph); + ok(!msg->dwType, "got %#lx\n", msg->dwType); + ok(!msg->dwVoiceID, "got %ld\n", msg->dwVoiceID); + ok(!msg->dwGroupID, "got %ld\n", msg->dwGroupID); + ok(!msg->punkUser, "got %p\n", msg->punkUser); + hr = IDirectMusicPerformance_SendPMsg(performance, msg); + todo_wine ok(hr == E_INVALIDARG, "got %#lx\n", hr); + + hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, msg, NULL); + todo_wine ok(hr == E_POINTER, "got %#lx\n", hr); + hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, NULL, &clone); + todo_wine ok(hr == E_POINTER, "got %#lx\n", hr); + clone = NULL; + hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, msg, &clone); + ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(clone != NULL, "got %p\n", clone); + + msg->mtTime = 500; + msg->dwFlags = DMUS_PMSGF_MUSICTIME; + hr = IDirectMusicPerformance_SendPMsg(performance, msg); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + hr = IDirectMusicPerformance_SendPMsg(performance, msg); + ok(hr == DMUS_E_ALREADY_SENT, "got %#lx\n", hr); + hr = IDirectMusicPerformance_FreePMsg(performance, msg); + ok(hr == DMUS_E_CANNOT_FREE, "got %#lx\n", hr); + + if (!clone) hr = S_OK; + else hr = IDirectMusicPerformance_FreePMsg(performance, clone); + ok(hr == S_OK, "got %#lx\n", hr); + + + time = 0xdeadbeef; + hr = IDirectMusicPerformance_MusicToReferenceTime(performance, msg->mtTime, &time); + ok(hr == S_OK, "got %#lx\n", hr); + ok(msg->dwSize == sizeof(DMUS_PMSG), "got %ld\n", msg->dwSize); + todo_wine ok(msg->rtTime == time, "got %I64d\n", msg->rtTime); + ok(msg->mtTime == 500, "got %ld\n", msg->mtTime); + todo_wine ok(msg->dwFlags & DMUS_PMSGF_REFTIME, "got %#lx\n", msg->dwFlags); + todo_wine ok(msg->dwFlags & (DMUS_PMSGF_TOOL_QUEUE | DMUS_PMSGF_TOOL_IMMEDIATE), "got %#lx\n", msg->dwFlags); + ok(!msg->dwPChannel, "got %ld\n", msg->dwPChannel); + ok(!msg->dwVirtualTrackID, "got %ld\n", msg->dwVirtualTrackID); + ok(!msg->pTool, "got %p\n", msg->pTool); + ok(!msg->pGraph, "got %p\n", msg->pGraph); + ok(!msg->dwType, "got %#lx\n", msg->dwType); + ok(!msg->dwVoiceID, "got %ld\n", msg->dwVoiceID); + ok(!msg->dwGroupID, "got %ld\n", msg->dwGroupID); + ok(!msg->punkUser, "got %p\n", msg->punkUser); + + + hr = IDirectMusicPerformance_CloseDown(performance); + ok(hr == S_OK, "got %#lx\n", hr); + + + IDirectMusicPerformance_Release(performance); +} + START_TEST(dmime) { CoInitialize(NULL); @@ -1717,6 +1840,7 @@ START_TEST(dmime) test_performance_tool(); test_performance_graph(); test_performance_time(); + test_performance_pmsg(); CoUninitialize(); }
1
0
0
0
Rémi Bernon : dmime/tests: Test IDirectMusicPerformance time conversion.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: a874f60cae59f5cda98e6d02acbf1ead343141ae URL:
https://gitlab.winehq.org/wine/wine/-/commit/a874f60cae59f5cda98e6d02acbf1e…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 5 16:27:17 2023 +0200 dmime/tests: Test IDirectMusicPerformance time conversion. --- dlls/dmime/tests/dmime.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 42eb4b1f47e..7fa832ebfd5 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -1601,6 +1601,96 @@ skip_graph2: IDirectMusicTool_Release(tool); } +static void test_performance_time(void) +{ + IDirectMusicPerformance *performance; + REFERENCE_TIME init_time, time; + IReferenceClock *clock; + MUSIC_TIME music_time; + IDirectMusic *dmusic; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicPerformance, (void **)&performance); + ok(hr == S_OK, "got %#lx\n", hr); + + + hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 0, NULL); + todo_wine ok(hr == E_POINTER, "got %#lx\n", hr); + time = 0xdeadbeef; + hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 0, &time); + todo_wine ok(hr == DMUS_E_NO_MASTER_CLOCK, "got %#lx\n", hr); + todo_wine ok(time == 0, "got %I64d\n", time); + + hr = IDirectMusicPerformance_ReferenceToMusicTime(performance, 0, NULL); + todo_wine ok(hr == E_POINTER, "got %#lx\n", hr); + music_time = 0xdeadbeef; + hr = IDirectMusicPerformance_ReferenceToMusicTime(performance, 0, &music_time); + todo_wine ok(hr == DMUS_E_NO_MASTER_CLOCK, "got %#lx\n", hr); + todo_wine ok(music_time == 0, "got %ld\n", music_time); + + + dmusic = NULL; + hr = IDirectMusicPerformance_Init(performance, &dmusic, NULL, NULL); + ok(hr == S_OK, "got %#lx\n", hr); + hr = IDirectMusic_GetMasterClock(dmusic, NULL, &clock); + ok(hr == S_OK, "got %#lx\n", hr); + IDirectMusic_Release(dmusic); + hr = IReferenceClock_GetTime(clock, &init_time); + ok(hr == S_OK, "got %#lx\n", hr); + IReferenceClock_Release(clock); + + + time = 0xdeadbeef; + hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 0, &time); + ok(hr == S_OK, "got %#lx\n", hr); + ok(time - init_time <= 100 * 10000, "got %I64d\n", time - init_time); + init_time = time; + + time = 0xdeadbeef; + hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 1, &time); + ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(time - init_time >= 6505, "got %I64d\n", time - init_time); + ok(time - init_time <= 6515, "got %I64d\n", time - init_time); + time = 0xdeadbeef; + hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 1000, &time); + ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(time - init_time >= 1000 * 6505, "got %I64d\n", time - init_time); + ok(time - init_time <= 1000 * 6515, "got %I64d\n", time - init_time); + time = 0xdeadbeef; + hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 2000, &time); + ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(time - init_time >= 2000 * 6505, "got %I64d\n", time - init_time); + ok(time - init_time <= 2000 * 6515, "got %I64d\n", time - init_time); + + music_time = 0xdeadbeef; + hr = IDirectMusicPerformance_ReferenceToMusicTime(performance, init_time, &music_time); + ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(music_time == 0, "got %ld\n", music_time); + music_time = 0xdeadbeef; + hr = IDirectMusicPerformance_ReferenceToMusicTime(performance, init_time + 1000 * 6510, &music_time); + ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(music_time == 1000, "got %ld\n", music_time); + music_time = 0xdeadbeef; + hr = IDirectMusicPerformance_ReferenceToMusicTime(performance, init_time + 2000 * 6510, &music_time); + ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(music_time == 2000, "got %ld\n", music_time); + + time = 0xdeadbeef; + music_time = 0xdeadbeef; + hr = IDirectMusicPerformance_GetTime(performance, &time, &music_time); + ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(time - init_time <= 200 * 10000, "got %I64d\n", time - init_time); + todo_wine ok(music_time == (time - init_time) / 6510, "got %ld\n", music_time); + + + hr = IDirectMusicPerformance_CloseDown(performance); + ok(hr == S_OK, "got %#lx\n", hr); + + IDirectMusicPerformance_Release(performance); + +} + START_TEST(dmime) { CoInitialize(NULL); @@ -1626,6 +1716,7 @@ START_TEST(dmime) test_parsedescriptor(); test_performance_tool(); test_performance_graph(); + test_performance_time(); CoUninitialize(); }
1
0
0
0
Rémi Bernon : dmime/tests: Test performance IDirectMusicGraph interface.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: cd5c9b800d275ba91899c2ad9a8739bcad0c6be0 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cd5c9b800d275ba91899c2ad9a8739…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 5 08:29:57 2023 +0200 dmime/tests: Test performance IDirectMusicGraph interface. --- dlls/dmime/tests/dmime.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index da1b4b4d8b8..42eb4b1f47e 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -1478,6 +1478,129 @@ skip_tool: IDirectMusicPerformance_Release(performance); } +static void test_performance_graph(void) +{ + IDirectMusicPerformance *performance; + IDirectMusicGraph *graph, *tmp_graph; + IDirectMusicTool *tool, *tmp_tool; + DMUS_PMSG msg; + HRESULT hr; + + hr = test_tool_create(&tool); + ok(hr == S_OK, "got %#lx\n", hr); + + hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicPerformance, (void **)&performance); + ok(hr == S_OK, "got %#lx\n", hr); + + + /* performance exposes a graph interface but it's not an actual toolgraph */ + hr = IDirectMusicPerformance_QueryInterface(performance, &IID_IDirectMusicGraph, (void **)&graph); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + if (hr != S_OK) goto skip_graph; + hr = IDirectMusicGraph_InsertTool(graph, (IDirectMusicTool *)tool, NULL, 0, -1); + ok(hr == E_NOTIMPL, "got %#lx\n", hr); + hr = IDirectMusicGraph_GetTool(graph, 0, &tmp_tool); + ok(hr == E_NOTIMPL, "got %#lx\n", hr); + hr = IDirectMusicGraph_RemoveTool(graph, tool); + ok(hr == E_NOTIMPL, "got %#lx\n", hr); + + /* test IDirectMusicGraph_StampPMsg usage */ + hr = IDirectMusicGraph_StampPMsg(graph, NULL); + todo_wine ok(hr == E_POINTER, "got %#lx\n", hr); + memset(&msg, 0, sizeof(msg)); + hr = IDirectMusicGraph_StampPMsg(graph, &msg); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + ok(msg.pGraph == NULL, "got %p\n", msg.pGraph); + todo_wine ok(msg.pTool != NULL, "got %p\n", msg.pTool); + if (msg.pTool) check_interface(msg.pTool, &IID_IDirectMusicPerformance, TRUE); + + ok(!msg.dwSize, "got %ld\n", msg.dwSize); + ok(!msg.rtTime, "got %I64d\n", msg.rtTime); + ok(!msg.mtTime, "got %ld\n", msg.mtTime); + todo_wine ok(msg.dwFlags == DMUS_PMSGF_TOOL_QUEUE, "got %#lx\n", msg.dwFlags); + ok(!msg.dwPChannel, "got %ld\n", msg.dwPChannel); + ok(!msg.dwVirtualTrackID, "got %ld\n", msg.dwVirtualTrackID); + ok(!msg.dwType, "got %#lx\n", msg.dwType); + ok(!msg.dwVoiceID, "got %ld\n", msg.dwVoiceID); + ok(!msg.dwGroupID, "got %ld\n", msg.dwGroupID); + ok(!msg.punkUser, "got %p\n", msg.punkUser); + + hr = IDirectMusicGraph_StampPMsg(graph, &msg); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + ok(msg.pGraph == NULL, "got %p\n", msg.pGraph); + todo_wine ok(msg.pTool != NULL, "got %p\n", msg.pTool); + if (msg.pTool) check_interface(msg.pTool, &IID_IDirectMusicPerformance, TRUE); + + if (msg.pTool) IDirectMusicTool_Release(msg.pTool); + msg.pTool = NULL; + + IDirectMusicGraph_Release(graph); + + +skip_graph: + /* performance doesn't have a default embedded toolgraph */ + hr = IDirectMusicPerformance_GetGraph(performance, &graph); + ok(hr == DMUS_E_NOT_FOUND, "got %#lx\n", hr); + + + /* test adding a graph to the performance */ + hr = CoCreateInstance(&CLSID_DirectMusicGraph, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicGraph, (void **)&graph); + ok(hr == S_OK, "got %#lx\n", hr); + hr = IDirectMusicPerformance_SetGraph(performance, graph); + ok(hr == S_OK, "got %#lx\n", hr); + + hr = IDirectMusicPerformance_GetGraph(performance, &tmp_graph); + ok(hr == S_OK, "got %#lx\n", hr); + ok(tmp_graph == graph, "got %p\n", graph); + IDirectMusicGraph_Release(tmp_graph); + + hr = IDirectMusicGraph_InsertTool(graph, (IDirectMusicTool *)tool, NULL, 0, -1); + ok(hr == S_OK, "got %#lx\n", hr); + + IDirectMusicGraph_Release(graph); + + + /* test IDirectMusicGraph_StampPMsg usage */ + hr = IDirectMusicPerformance_QueryInterface(performance, &IID_IDirectMusicGraph, (void **)&graph); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + if (hr != S_OK) goto skip_graph2; + + memset(&msg, 0, sizeof(msg)); + hr = IDirectMusicGraph_StampPMsg(graph, &msg); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(msg.pGraph == graph, "got %p\n", msg.pGraph); + todo_wine ok(msg.pTool == tool, "got %p\n", msg.pTool); + + ok(!msg.dwSize, "got %ld\n", msg.dwSize); + ok(!msg.rtTime, "got %I64d\n", msg.rtTime); + ok(!msg.mtTime, "got %ld\n", msg.mtTime); + todo_wine ok(msg.dwFlags == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", msg.dwFlags); + ok(!msg.dwPChannel, "got %ld\n", msg.dwPChannel); + ok(!msg.dwVirtualTrackID, "got %ld\n", msg.dwVirtualTrackID); + ok(!msg.dwType, "got %#lx\n", msg.dwType); + ok(!msg.dwVoiceID, "got %ld\n", msg.dwVoiceID); + ok(!msg.dwGroupID, "got %ld\n", msg.dwGroupID); + ok(!msg.punkUser, "got %p\n", msg.punkUser); + + hr = IDirectMusicGraph_StampPMsg(graph, &msg); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + ok(msg.pGraph == NULL, "got %p\n", msg.pGraph); + todo_wine ok(msg.pTool != NULL, "got %p\n", msg.pTool); + if (msg.pTool) check_interface(msg.pTool, &IID_IDirectMusicPerformance, TRUE); + + if (msg.pTool) IDirectMusicTool_Release(msg.pTool); + msg.pTool = NULL; + + IDirectMusicGraph_Release(graph); + + +skip_graph2: + IDirectMusicPerformance_Release(performance); + IDirectMusicTool_Release(tool); +} + START_TEST(dmime) { CoInitialize(NULL); @@ -1502,6 +1625,7 @@ START_TEST(dmime) test_track(); test_parsedescriptor(); test_performance_tool(); + test_performance_graph(); CoUninitialize(); }
1
0
0
0
Rémi Bernon : dmime/tests: Test performance IDirectMusicTool interface.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: 5efaae40deaf4c33780832bb349fb61e1f5d0123 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5efaae40deaf4c33780832bb349fb6…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 5 08:32:42 2023 +0200 dmime/tests: Test performance IDirectMusicTool interface. --- dlls/dmime/tests/dmime.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 2c84fee05ad..da1b4b4d8b8 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -27,6 +27,34 @@ #include <audioclient.h> #include <guiddef.h> +static ULONG get_refcount(void *iface) +{ + IUnknown *unknown = iface; + IUnknown_AddRef(unknown); + return IUnknown_Release(unknown); +} + +#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c) +static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported) +{ + ULONG expect_ref = get_refcount(iface_ptr); + IUnknown *iface = iface_ptr; + HRESULT hr, expected; + IUnknown *unk; + + expected = supported ? S_OK : E_NOINTERFACE; + hr = IUnknown_QueryInterface(iface, iid, (void **)&unk); + ok_(__FILE__, line)(hr == expected, "got hr %#lx, expected %#lx.\n", hr, expected); + if (SUCCEEDED(hr)) + { + LONG ref = get_refcount(unk); + ok_(__FILE__, line)(ref == expect_ref + 1, "got %ld\n", ref); + IUnknown_Release(unk); + ref = get_refcount(iface_ptr); + ok_(__FILE__, line)(ref == expect_ref, "got %ld\n", ref); + } +} + struct test_tool { IDirectMusicTool IDirectMusicTool_iface; @@ -1405,6 +1433,51 @@ static void test_parsedescriptor(void) } } +static void test_performance_tool(void) +{ + IDirectMusicPerformance *performance; + IDirectMusicGraph *graph; + IDirectMusicTool *tool; + DWORD value, types[1]; + DMUS_PMSG msg = {0}; + HRESULT hr; + + hr = CoCreateInstance(&CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicPerformance, (void **)&performance); + ok(hr == S_OK, "got %#lx\n", hr); + + check_interface(performance, &IID_IDirectMusicTool8, FALSE); + + hr = IDirectMusicPerformance_QueryInterface(performance, &IID_IDirectMusicTool, (void **)&tool); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + if (hr != S_OK) goto skip_tool; + hr = IDirectMusicPerformance_QueryInterface(performance, &IID_IDirectMusicGraph, (void **)&graph); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + + hr = IDirectMusicTool_Init(tool, graph); + ok(hr == E_NOTIMPL, "got %#lx\n", hr); + value = 0xdeadbeef; + hr = IDirectMusicTool_GetMsgDeliveryType(tool, &value); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(value == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", value); + value = 0xdeadbeef; + hr = IDirectMusicTool_GetMediaTypeArraySize(tool, &value); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + todo_wine ok(value == 0, "got %#lx\n", value); + hr = IDirectMusicTool_GetMediaTypes(tool, (DWORD **)&types, 64); + ok(hr == E_NOTIMPL, "got %#lx\n", hr); + hr = IDirectMusicTool_ProcessPMsg(tool, performance, &msg); + todo_wine ok(hr == DMUS_S_FREE, "got %#lx\n", hr); + hr = IDirectMusicTool_Flush(tool, performance, &msg, 0); + todo_wine ok(hr == S_OK, "got %#lx\n", hr); + + IDirectMusicGraph_Release(graph); + IDirectMusicTool_Release(tool); + +skip_tool: + IDirectMusicPerformance_Release(performance); +} + START_TEST(dmime) { CoInitialize(NULL); @@ -1428,6 +1501,7 @@ START_TEST(dmime) test_segment_param(); test_track(); test_parsedescriptor(); + test_performance_tool(); CoUninitialize(); }
1
0
0
0
Rémi Bernon : dmime/tests: Test IDirectMusicGraph interface with a dummy tool.
by Alexandre Julliard
08 Sep '23
08 Sep '23
Module: wine Branch: master Commit: 881e424683eb1f2493c4d4524e65127a6277a3f4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/881e424683eb1f2493c4d4524e6512…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Sep 4 23:47:56 2023 +0200 dmime/tests: Test IDirectMusicGraph interface with a dummy tool. --- dlls/dmime/tests/dmime.c | 285 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 281 insertions(+), 4 deletions(-)
1
0
0
0
← Newer
1
...
70
71
72
73
74
75
76
...
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