winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
920 discussions
Start a n
N
ew thread
Rémi Bernon : dmime: Cleanup IDirectMusicPerformance_FreePMsg.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: 4adeeb72d3e023bcefe0adebff9565ca45a8a1a9 URL:
https://gitlab.winehq.org/wine/wine/-/commit/4adeeb72d3e023bcefe0adebff9565…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 5 10:45:43 2023 +0200 dmime: Cleanup IDirectMusicPerformance_FreePMsg. --- dlls/dmime/performance.c | 47 ++++++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 7cf446d9816..bcb7faa405e 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -80,7 +80,7 @@ struct DMUS_PMSGItem { DMUS_PMSG pMsg; }; -#define DMUS_PMSGToItem(pMSG) ((DMUS_PMSGItem*) (((unsigned char*) pPMSG) - offsetof(DMUS_PMSGItem, pMsg))) +#define DMUS_PMSGToItem(pMSG) ((DMUS_PMSGItem *)(((unsigned char *)pMSG) - offsetof(DMUS_PMSGItem, pMsg))) #define DMUS_ItemRemoveFromQueue(This,pItem) \ {\ if (pItem->prev) pItem->prev->next = pItem->next;\ @@ -531,37 +531,30 @@ static HRESULT WINAPI performance_AllocPMsg(IDirectMusicPerformance8 *iface, ULO return S_OK; } -static HRESULT WINAPI performance_FreePMsg(IDirectMusicPerformance8 *iface, DMUS_PMSG *pPMSG) +static HRESULT WINAPI performance_FreePMsg(IDirectMusicPerformance8 *iface, DMUS_PMSG *msg) { - struct performance *This = impl_from_IDirectMusicPerformance8(iface); - DMUS_PMSGItem* pItem = NULL; - - FIXME("(%p, %p): stub\n", This, pPMSG); - - if (NULL == pPMSG) { - return E_POINTER; - } - pItem = DMUS_PMSGToItem(pPMSG); - if (pItem->bInUse) { - /** prevent for freeing PMsg in queue (ie to be processed) */ - return DMUS_E_CANNOT_FREE; - } - /** now we can remove it safely */ - EnterCriticalSection(&This->safe); - DMUS_ItemRemoveFromQueue( This, pItem ); - LeaveCriticalSection(&This->safe); + struct performance *This = impl_from_IDirectMusicPerformance8(iface); + DMUS_PMSGItem *message; + HRESULT hr; - if (pPMSG->pTool) - IDirectMusicTool_Release(pPMSG->pTool); + TRACE("(%p, %p)\n", This, msg); - if (pPMSG->pGraph) - IDirectMusicGraph_Release(pPMSG->pGraph); + if (!msg) return E_POINTER; + message = DMUS_PMSGToItem(msg); - if (pPMSG->punkUser) - IUnknown_Release(pPMSG->punkUser); + EnterCriticalSection(&This->safe); + hr = message->bInUse ? DMUS_E_CANNOT_FREE : S_OK; + LeaveCriticalSection(&This->safe); - free(pItem); - return S_OK; + if (SUCCEEDED(hr)) + { + if (msg->pTool) IDirectMusicTool_Release(msg->pTool); + if (msg->pGraph) IDirectMusicGraph_Release(msg->pGraph); + if (msg->punkUser) IUnknown_Release(msg->punkUser); + free(message); + } + + return hr; } static HRESULT WINAPI performance_GetGraph(IDirectMusicPerformance8 *iface, IDirectMusicGraph **graph)
1
0
0
0
Rémi Bernon : dmime: Cleanup IDirectMusicPerformance_AllocPMsg.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: 9d600ce191ffcf3af374142a7b3a8654b67aa8d5 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9d600ce191ffcf3af374142a7b3a86…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Tue Sep 5 10:44:16 2023 +0200 dmime: Cleanup IDirectMusicPerformance_AllocPMsg. --- dlls/dmime/performance.c | 27 ++++++++++++--------------- dlls/dmime/tests/dmime.c | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 7ce8ccb0d84..7cf446d9816 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -81,7 +81,6 @@ struct DMUS_PMSGItem { }; #define DMUS_PMSGToItem(pMSG) ((DMUS_PMSGItem*) (((unsigned char*) pPMSG) - offsetof(DMUS_PMSGItem, pMsg))) -#define DMUS_ItemToPMSG(pItem) (&(pItem->pMsg)) #define DMUS_ItemRemoveFromQueue(This,pItem) \ {\ if (pItem->prev) pItem->prev->next = pItem->next;\ @@ -515,23 +514,21 @@ static HRESULT WINAPI performance_GetTime(IDirectMusicPerformance8 *iface, REFER return hr; } -static HRESULT WINAPI performance_AllocPMsg(IDirectMusicPerformance8 *iface, ULONG cb, DMUS_PMSG **ppPMSG) +static HRESULT WINAPI performance_AllocPMsg(IDirectMusicPerformance8 *iface, ULONG size, DMUS_PMSG **msg) { - struct performance *This = impl_from_IDirectMusicPerformance8(iface); - DMUS_PMSGItem* pItem = NULL; + struct performance *This = impl_from_IDirectMusicPerformance8(iface); + DMUS_PMSGItem *message; - FIXME("(%p, %ld, %p): stub\n", This, cb, ppPMSG); + TRACE("(%p, %ld, %p)\n", This, size, msg); - if (sizeof(DMUS_PMSG) > cb) { - return E_INVALIDARG; - } - if (NULL == ppPMSG) { - return E_POINTER; - } - if (!(pItem = calloc(1, cb - sizeof(DMUS_PMSG) + sizeof(DMUS_PMSGItem)))) return E_OUTOFMEMORY; - pItem->pMsg.dwSize = cb; - *ppPMSG = DMUS_ItemToPMSG(pItem); - return S_OK; + if (!msg) return E_POINTER; + if (size < sizeof(DMUS_PMSG)) return E_INVALIDARG; + + if (!(message = calloc(1, size - sizeof(DMUS_PMSG) + sizeof(DMUS_PMSGItem)))) return E_OUTOFMEMORY; + message->pMsg.dwSize = size; + *msg = &message->pMsg; + + return S_OK; } static HRESULT WINAPI performance_FreePMsg(IDirectMusicPerformance8 *iface, DMUS_PMSG *pPMSG) diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 8999d5564db..5a1d5c9733e 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -1747,7 +1747,7 @@ static void test_performance_pmsg(void) hr = IDirectMusicPerformance_AllocPMsg(performance, 0, NULL); - todo_wine ok(hr == E_POINTER, "got %#lx\n", hr); + 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);
1
0
0
0
Rémi Bernon : dmime: Implement MusicToReferenceTime and ReferenceToMusicTime.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: 52ae3fada0baa400936997ce3dfb997ddbe03dab URL:
https://gitlab.winehq.org/wine/wine/-/commit/52ae3fada0baa400936997ce3dfb99…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 14 12:28:17 2023 +0200 dmime: Implement MusicToReferenceTime and ReferenceToMusicTime. --- dlls/dmime/performance.c | 40 ++++++++++++++++++++++++++++++++-------- dlls/dmime/tests/dmime.c | 28 ++++++++++++++-------------- 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 5ae8941cd76..7ce8ccb0d84 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -66,6 +66,7 @@ struct performance struct DMUS_PMSGItem *imm_head; IReferenceClock *master_clock; + REFERENCE_TIME init_time; }; typedef struct DMUS_PMSGItem DMUS_PMSGItem; @@ -451,21 +452,41 @@ static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS } static HRESULT WINAPI performance_MusicToReferenceTime(IDirectMusicPerformance8 *iface, - MUSIC_TIME mtTime, REFERENCE_TIME *prtTime) + MUSIC_TIME music_time, REFERENCE_TIME *time) { - struct performance *This = impl_from_IDirectMusicPerformance8(iface); + struct performance *This = impl_from_IDirectMusicPerformance8(iface); - FIXME("(%p, %ld, %p): stub\n", This, mtTime, prtTime); - return S_OK; + FIXME("(%p, %ld, %p): semi-stub\n", This, music_time, time); + + if (!time) return E_POINTER; + *time = 0; + + if (!This->master_clock) return DMUS_E_NO_MASTER_CLOCK; + + /* FIXME: This should be (music_time * 60) / (DMUS_PPQ * tempo) + * but it gives innacurate results */ + *time = This->init_time + (music_time * 6510); + + return S_OK; } static HRESULT WINAPI performance_ReferenceToMusicTime(IDirectMusicPerformance8 *iface, - REFERENCE_TIME rtTime, MUSIC_TIME *pmtTime) + REFERENCE_TIME time, MUSIC_TIME *music_time) { - struct performance *This = impl_from_IDirectMusicPerformance8(iface); + struct performance *This = impl_from_IDirectMusicPerformance8(iface); - FIXME("(%p, 0x%s, %p): stub\n", This, wine_dbgstr_longlong(rtTime), pmtTime); - return S_OK; + FIXME("(%p, %I64d, %p): semi-stub\n", This, time, music_time); + + if (!music_time) return E_POINTER; + *music_time = 0; + + if (!This->master_clock) return DMUS_E_NO_MASTER_CLOCK; + + /* FIXME: This should be (time * DMUS_PPQ * tempo) / 60 + * but it gives innacurate results */ + *music_time = (time - This->init_time) / 6510; + + return S_OK; } static HRESULT WINAPI performance_IsPlaying(IDirectMusicPerformance8 *iface, @@ -1006,6 +1027,9 @@ static HRESULT WINAPI performance_InitAudio(IDirectMusicPerformance8 *iface, IDi *dmusic = (IDirectMusic *)This->dmusic; IDirectMusic_AddRef(*dmusic); } + + if (FAILED(hr = IDirectMusicPerformance8_GetTime(iface, &This->init_time, NULL))) return hr; + PostMessageToProcessMsgThread(This, PROCESSMSG_START); return S_OK; diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index e178960b18f..8999d5564db 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -1650,18 +1650,18 @@ static void test_performance_time(void) hr = IDirectMusicPerformance_MusicToReferenceTime(performance, 0, NULL); - todo_wine ok(hr == E_POINTER, "got %#lx\n", hr); + 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); + ok(hr == DMUS_E_NO_MASTER_CLOCK, "got %#lx\n", hr); + ok(time == 0, "got %I64d\n", time); hr = IDirectMusicPerformance_ReferenceToMusicTime(performance, 0, NULL); - todo_wine ok(hr == E_POINTER, "got %#lx\n", hr); + 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); + ok(hr == DMUS_E_NO_MASTER_CLOCK, "got %#lx\n", hr); + ok(music_time == 0, "got %ld\n", music_time); dmusic = NULL; @@ -1684,38 +1684,38 @@ static void test_performance_time(void) 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 >= 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 * 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 * 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); + 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); + 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); + 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); + ok(time - init_time <= 200 * 10000, "got %I64d\n", time - init_time); + ok(music_time == (time - init_time) / 6510, "got %ld\n", music_time); hr = IDirectMusicPerformance_CloseDown(performance);
1
0
0
0
Rémi Bernon : dmime: Rewrite IDirectMusicPerformance8_GetTime.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: d407b3ca52cc5afdb6beee13672a06ca2e57d042 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d407b3ca52cc5afdb6beee13672a06…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 14 12:24:35 2023 +0200 dmime: Rewrite IDirectMusicPerformance8_GetTime. --- dlls/dmime/performance.c | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index d277c5de043..5ae8941cd76 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -60,11 +60,12 @@ struct performance /** Message Processing */ HANDLE procThread; DWORD procThreadId; - REFERENCE_TIME procThreadStartTime; BOOL procThreadTicStarted; CRITICAL_SECTION safe; struct DMUS_PMSGItem *head; struct DMUS_PMSGItem *imm_head; + + IReferenceClock *master_clock; }; typedef struct DMUS_PMSGItem DMUS_PMSGItem; @@ -476,25 +477,21 @@ static HRESULT WINAPI performance_IsPlaying(IDirectMusicPerformance8 *iface, return S_FALSE; } -static HRESULT WINAPI performance_GetTime(IDirectMusicPerformance8 *iface, REFERENCE_TIME *prtNow, MUSIC_TIME *pmtNow) +static HRESULT WINAPI performance_GetTime(IDirectMusicPerformance8 *iface, REFERENCE_TIME *time, MUSIC_TIME *music_time) { - struct performance *This = impl_from_IDirectMusicPerformance8(iface); - HRESULT hr = S_OK; - REFERENCE_TIME rtCur = 0; + struct performance *This = impl_from_IDirectMusicPerformance8(iface); + REFERENCE_TIME now; + HRESULT hr; - /*TRACE("(%p, %p, %p)\n", This, prtNow, pmtNow); */ - if (This->procThreadTicStarted) { - rtCur = ((REFERENCE_TIME) GetTickCount() * 10000) - This->procThreadStartTime; - } else { - /*return DMUS_E_NO_MASTER_CLOCK;*/ - } - if (NULL != prtNow) { - *prtNow = rtCur; - } - if (NULL != pmtNow) { - hr = IDirectMusicPerformance8_ReferenceToMusicTime(iface, rtCur, pmtNow); - } - return hr; + TRACE("(%p, %p, %p)\n", iface, time, music_time); + + if (!This->master_clock) return DMUS_E_NO_MASTER_CLOCK; + if (FAILED(hr = IReferenceClock_GetTime(This->master_clock, &now))) return hr; + + if (time) *time = now; + if (music_time) hr = IDirectMusicPerformance8_ReferenceToMusicTime(iface, now, music_time); + + return hr; } static HRESULT WINAPI performance_AllocPMsg(IDirectMusicPerformance8 *iface, ULONG cb, DMUS_PMSG **ppPMSG) @@ -873,6 +870,11 @@ static HRESULT WINAPI performance_CloseDown(IDirectMusicPerformance8 *iface) This->procThreadTicStarted = FALSE; CloseHandle(This->procThread); } + if (This->master_clock) + { + IReferenceClock_Release(This->master_clock); + This->master_clock = NULL; + } if (This->dsound) { IDirectSound_Release(This->dsound); This->dsound = NULL; @@ -955,6 +957,9 @@ static HRESULT WINAPI performance_InitAudio(IDirectMusicPerformance8 *iface, IDi IDirectMusic8_AddRef(This->dmusic); } + if (FAILED(hr = IDirectMusic_GetMasterClock(This->dmusic, NULL, &This->master_clock))) + goto error; + if (!dsound || !*dsound) { hr = DirectSoundCreate8(NULL, (IDirectSound8 **)&This->dsound, NULL); if (FAILED(hr)) @@ -1006,6 +1011,11 @@ static HRESULT WINAPI performance_InitAudio(IDirectMusicPerformance8 *iface, IDi return S_OK; error: + if (This->master_clock) + { + IReferenceClock_Release(This->master_clock); + This->master_clock = NULL; + } if (This->dsound) { IDirectSound_Release(This->dsound); This->dsound = NULL;
1
0
0
0
Jacek Caban : wow64win: Implement wow64_NtUserImmTranslateMessage.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: 02ea15b1fb447dea79b8efbbc05edd16266f7353 URL:
https://gitlab.winehq.org/wine/wine/-/commit/02ea15b1fb447dea79b8efbbc05edd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 13 23:50:12 2023 +0200 wow64win: Implement wow64_NtUserImmTranslateMessage. --- dlls/wow64win/user.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 7a6872921b2..43d83470a64 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -1303,8 +1303,20 @@ static NTSTATUS WINAPI wow64_NtUserImmProcessKey( void *arg, ULONG size ) static NTSTATUS WINAPI wow64_NtUserImmTranslateMessage( void *arg, ULONG size ) { - FIXME( "\n" ); - return 0; + struct imm_translate_message_params *params = arg; + struct + { + LONG hwnd; + UINT msg; + LONG wparam; + LONG key_data; + } params32; + + params32.hwnd = HandleToLong( params->hwnd ); + params32.msg = params->msg; + params32.wparam = params->wparam; + params32.key_data = params->key_data; + return dispatch_callback( NtUserImmTranslateMessage, ¶ms32, sizeof(params32) ); } static NTSTATUS WINAPI wow64_NtUserInitBuiltinClasses( void *arg, ULONG size )
1
0
0
0
Alfred Agrell : quartz/tests: Fix segfault in changed3ddevice test.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: f8d9bf365159d9155f7728ba9b6e5babf5d41cc4 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f8d9bf365159d9155f7728ba9b6e5b…
Author: Alfred Agrell <floating(a)muncher.se> Date: Thu Sep 14 11:01:09 2023 +0200 quartz/tests: Fix segfault in changed3ddevice test. --- dlls/quartz/tests/vmr9.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 6e566f39c58..447273a91df 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -4335,10 +4335,10 @@ static void test_changed3ddevice(void) IDirect3DDevice9 *device, *device2; RECT rect = {0, 0, 640, 480}; struct testfilter source; + IPin *pin = NULL; HWND window; HRESULT hr; ULONG ref; - IPin *pin; testfilter_init(&source); @@ -4386,7 +4386,8 @@ static void test_changed3ddevice(void) IDirect3DDevice9_Release(device2); out: - IPin_Release(pin); + if (pin) + IPin_Release(pin); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %ld.\n", ref); IVMRSurfaceAllocatorNotify9_Release(notify);
1
0
0
0
Jacek Caban : ntdll/tests: Add tests for setting context on unsuspended thread.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: 918eeb0d7346581efa337c9f92e4154636b15121 URL:
https://gitlab.winehq.org/wine/wine/-/commit/918eeb0d7346581efa337c9f92e415…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 14 19:29:50 2023 +0200 ntdll/tests: Add tests for setting context on unsuspended thread. Based on patch by Evan Tang. --- dlls/ntdll/tests/exception.c | 82 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index 945a5a8bb99..6164c799ba1 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -11262,6 +11262,86 @@ static void test_copy_context(void) dst_xs->Mask == 4, sizeof(dst_xs->YmmContext)); } } + +#if defined(__i386__) +# define IP_REG(ctx) ctx.Eip +#else +# define IP_REG(ctx) ctx.Rip +#endif + +static volatile int exit_ip_test; +static WINAPI DWORD ip_test_thread_proc( void *param ) +{ + SetEvent( param ); + while (!exit_ip_test); + return ERROR_SUCCESS; +} + +static void test_set_live_context(void) +{ + UINT_PTR old_ip, target; + HANDLE thread, event; + char *target_ptr; + CONTEXT ctx; + DWORD res; + int i; + + /* jmp to self at offset 0 and 4 */ + static const char target_code[] = {0xeb, 0xfe, 0x90, 0x90, 0xeb, 0xfe}; + + target_ptr = VirtualAlloc( NULL, 65536, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE ); + memcpy( target_ptr, target_code, sizeof(target_code) ); + target = (UINT_PTR)target_ptr; + + event = CreateEventW( NULL, TRUE, FALSE, NULL ); + thread = CreateThread( NULL, 65536, ip_test_thread_proc, event, 0, NULL ); + ok( thread != NULL, "Failed to create thread: %lx\n", GetLastError() ); + res = WaitForSingleObject( event, 1000 ); + ok( !res, "wait returned: %ld\n", res ); + CloseHandle( event ); + + memset( &ctx, 0, sizeof(ctx) ); + ctx.ContextFlags = CONTEXT_ALL; + res = GetThreadContext( thread, &ctx ); + ok( res, "Failed to get thread context: %lx\n", GetLastError() ); + old_ip = IP_REG(ctx); + + IP_REG(ctx) = target; + res = SetThreadContext( thread, &ctx ); + ok( res, "Failed to set thread context: %lx\n", GetLastError() ); + + for (i = 0; i < 10; i++) + { + IP_REG(ctx) = target; + res = SetThreadContext( thread, &ctx ); + ok( res, "Failed to set thread context: %lx\n", GetLastError() ); + + ctx.ContextFlags = CONTEXT_ALL; + res = GetThreadContext( thread, &ctx ); + ok( res, "Failed to get thread context: %lx\n", GetLastError() ); + ok( IP_REG(ctx) == target, "IP = %p, expected %p\n", (void *)IP_REG(ctx), target_ptr ); + + IP_REG(ctx) = target + 4; + res = SetThreadContext( thread, &ctx ); + ok( res, "Failed to set thread context: %lx\n", GetLastError()) ; + + ctx.ContextFlags = CONTEXT_ALL; + res = GetThreadContext( thread, &ctx ); + ok( res, "Failed to get thread context: %lx\n", GetLastError() ); + ok( IP_REG(ctx) == target + 4, "IP = %p, expected %p\n", (void *)IP_REG(ctx), target_ptr + 4 ); + } + + exit_ip_test = 1; + ctx.ContextFlags = CONTEXT_ALL; + IP_REG(ctx) = old_ip; + res = SetThreadContext( thread, &ctx ); + ok( res, "Failed to restore thread context: %lx\n", GetLastError() ); + + res = WaitForSingleObject( thread, 1000 ); + ok( !res, "wait returned: %ld\n", res ); + + VirtualFree( target_ptr, 0, MEM_RELEASE ); +} #endif START_TEST(exception) @@ -11445,6 +11525,7 @@ START_TEST(exception) test_kiuserexceptiondispatcher(); test_extended_context(); test_copy_context(); + test_set_live_context(); #elif defined(__x86_64__) @@ -11487,6 +11568,7 @@ START_TEST(exception) win_skip( "Dynamic unwind functions not found\n" ); test_extended_context(); test_copy_context(); + test_set_live_context(); test_unwind_from_apc(); test_syscall_clobbered_regs(); test_raiseexception_regs();
1
0
0
0
Jacek Caban : server: Store both contexts in pending context object.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: a25ac1edb945ebd23a2378cbfa2b618984903c66 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a25ac1edb945ebd23a2378cbfa2b61…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 14 19:27:45 2023 +0200 server: Store both contexts in pending context object. And discard irrelevant parts in select request. --- server/thread.c | 67 +++++++++++++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/server/thread.c b/server/thread.c index 3e35b27f694..83ae381d5c5 100644 --- a/server/thread.c +++ b/server/thread.c @@ -119,11 +119,10 @@ struct context { struct object obj; /* object header */ unsigned int status; /* status of the context */ - context_t regs[3]; /* context data */ + context_t regs[2]; /* context data */ }; #define CTX_NATIVE 0 /* context for native machine */ #define CTX_WOW 1 /* context if thread is inside WoW */ -#define CTX_PENDING 2 /* pending native context when we don't know whether thread is inside WoW */ /* flags for registers that always need to be set from the server side */ static const unsigned int system_flags = SERVER_CTX_DEBUG_REGISTERS; @@ -292,7 +291,6 @@ static struct context *create_thread_context( struct thread *thread ) context->status = STATUS_PENDING; memset( &context->regs, 0, sizeof(context->regs) ); context->regs[CTX_NATIVE].machine = native_machine; - context->regs[CTX_PENDING].machine = native_machine; return context; } @@ -1591,8 +1589,6 @@ DECL_HANDLER(select) const context_t *native_context = (const context_t *)((const char *)(result + 1) + req->size); const context_t *wow_context = (ctx_count > 1) ? native_context + 1 : NULL; - if (current->context && current->context->status != STATUS_PENDING) goto invalid_param; - if (native_context->machine == native_machine) { if (wow_context && wow_context->machine != current->process->machine) goto invalid_param; @@ -1605,7 +1601,14 @@ DECL_HANDLER(select) } else goto invalid_param; - if (!current->context && !(current->context = create_thread_context( current ))) return; + if ((ctx = current->context)) + { + if (ctx->status != STATUS_PENDING) goto invalid_param; + /* if context was modified in pending state, discard irrelevant changes */ + if (wow_context) ctx->regs[CTX_NATIVE].flags &= ~ctx->regs[CTX_WOW].flags; + else ctx->regs[CTX_WOW].flags = ctx->regs[CTX_WOW].machine = 0; + } + else if (!(current->context = create_thread_context( current ))) return; ctx = current->context; if (native_context) @@ -1618,13 +1621,6 @@ DECL_HANDLER(select) ctx->regs[CTX_WOW].machine = current->process->machine; copy_context( &ctx->regs[CTX_WOW], wow_context, wow_context->flags & ~ctx->regs[CTX_WOW].flags ); } - else if (ctx->regs[CTX_PENDING].flags) - { - unsigned int flags = ctx->regs[CTX_PENDING].flags & ~ctx->regs[CTX_NATIVE].flags; - copy_context( &ctx->regs[CTX_NATIVE], &ctx->regs[CTX_PENDING], flags ); - ctx->regs[CTX_NATIVE].flags |= flags; - } - ctx->regs[CTX_PENDING].flags = 0; ctx->status = STATUS_SUCCESS; current->suspend_cookie = req->cookie; wake_up( &ctx->obj, 0 ); @@ -1931,36 +1927,37 @@ DECL_HANDLER(set_thread_context) set_error( STATUS_INVALID_PARAMETER ); else if (thread->state != TERMINATED) { - unsigned int ctx = CTX_NATIVE; - const context_t *context = &contexts[CTX_NATIVE]; - unsigned int flags = system_flags & context->flags; - unsigned int native_flags = context->flags & req->native_flags; + unsigned int flags = system_flags & contexts[CTX_NATIVE].flags; if (thread != current) stop_thread( thread ); - else if (flags) set_thread_context( thread, context, flags ); + else if (flags) set_thread_context( thread, &contexts[CTX_NATIVE], flags ); + if (thread->context && !get_error()) { - if (ctx_count == 2) + /* If context is in a pending state, we don't know if we will use WoW or native + * context, so store both and discard irrevelant one in select request. */ + const int is_pending = thread->context->status == STATUS_PENDING; + unsigned int native_flags = contexts[CTX_NATIVE].flags; + + if (ctx_count == 2 && (is_pending || thread->context->regs[CTX_WOW].machine)) { - /* If the target thread doesn't have a WoW context, set native instead. - * If we don't know yet whether we have a WoW context, store native context - * in CTX_PENDING and update when the target thread sends its context(s). */ - if (thread->context->status != STATUS_PENDING) - { - ctx = thread->context->regs[CTX_WOW].machine ? CTX_WOW : CTX_NATIVE; - context = &contexts[ctx]; - } - else ctx = CTX_PENDING; + context_t *ctx = &thread->context->regs[CTX_WOW]; + + /* some regs are always set from the native context */ + flags = contexts[CTX_WOW].flags & ~req->native_flags; + if (is_pending) ctx->machine = contexts[CTX_WOW].machine; + else native_flags &= req->native_flags; + + copy_context( ctx, &contexts[CTX_WOW], flags ); + ctx->flags |= flags; } - flags = context->flags; - if (native_flags && ctx != CTX_NATIVE) /* some regs are always set from the native context */ + + if (native_flags) { - copy_context( &thread->context->regs[CTX_NATIVE], &contexts[CTX_NATIVE], native_flags ); - thread->context->regs[CTX_NATIVE].flags |= native_flags; - flags &= ~native_flags; + context_t *ctx = &thread->context->regs[CTX_NATIVE]; + copy_context( ctx, &contexts[CTX_NATIVE], native_flags ); + ctx->flags |= native_flags; } - copy_context( &thread->context->regs[ctx], context, flags ); - thread->context->regs[ctx].flags |= flags; } } else set_error( STATUS_UNSUCCESSFUL );
1
0
0
0
Alexandre Julliard : localspl: Fix an uninitialized variable warning with clang.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: 949681d8c31d5fe25bb497bd7c24a637aa8e249c URL:
https://gitlab.winehq.org/wine/wine/-/commit/949681d8c31d5fe25bb497bd7c24a6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 14 12:32:33 2023 +0200 localspl: Fix an uninitialized variable warning with clang. --- dlls/localspl/provider.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c index f35931b9bef..762f61dbf57 100644 --- a/dlls/localspl/provider.c +++ b/dlls/localspl/provider.c @@ -1646,7 +1646,7 @@ static HANDLE xcv_alloc_handle(const WCHAR *name, PRINTER_DEFAULTSW *def, BOOL * { static const WCHAR xcv_monitor[] = L"XcvMonitor "; static const WCHAR xcv_port[] = L"XcvPort "; - BOOL mon, port; + BOOL mon; xcv_t *xcv; *stop_search = FALSE; @@ -1664,11 +1664,9 @@ static HANDLE xcv_alloc_handle(const WCHAR *name, PRINTER_DEFAULTSW *def, BOOL * } else { - port = !wcsncmp(name, xcv_port, ARRAY_SIZE(xcv_port) - 1); + if (wcsncmp(name, xcv_port, ARRAY_SIZE(xcv_port) - 1)) return NULL; name += ARRAY_SIZE(xcv_port) - 1; } - if (!port && !mon) - return NULL; *stop_search = TRUE; xcv = calloc(1, sizeof(*xcv));
1
0
0
0
Francois Gouget : kernel32/tests: Allow a 0 removed entry count in the completion test.
by Alexandre Julliard
14 Sep '23
14 Sep '23
Module: wine Branch: master Commit: c63b323e220f9e5d4fbf1829a2b2f03e24d4b6e2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/c63b323e220f9e5d4fbf1829a2b2f0…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Sep 14 12:11:28 2023 +0200 kernel32/tests: Allow a 0 removed entry count in the completion test. This matches the ntdll:file fix. Wine-Bug:
https://bugs.winehq.org//show_bug.cgi?id=54554
--- dlls/kernel32/tests/file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 65164d7f2a4..7044a992bb6 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -5559,7 +5559,7 @@ static void test_post_completion(void) ret = pGetQueuedCompletionStatusEx( port, entries, 2, &count, 0, FALSE ); ok(!ret, "GetQueuedCompletionStatusEx succeeded\n"); ok(GetLastError() == WAIT_TIMEOUT, "wrong error %lu\n", GetLastError()); - ok(count == 1, "wrong count %lu\n", count); + ok(count <= 1, "wrong count %lu\n", count); ret = PostQueuedCompletionStatus( port, 123, 456, &ovl ); ok(ret, "PostQueuedCompletionStatus failed: %lu\n", GetLastError()); @@ -5600,14 +5600,14 @@ static void test_post_completion(void) ret = pGetQueuedCompletionStatusEx( port, entries, 2, &count, 0, FALSE ); ok(!ret, "GetQueuedCompletionStatusEx succeeded\n"); ok(GetLastError() == WAIT_TIMEOUT, "wrong error %lu\n", GetLastError()); - ok(count == 1, "wrong count %lu\n", count); + ok(count <= 1, "wrong count %lu\n", count); ok(!user_apc_ran, "user APC should not have run\n"); ret = pGetQueuedCompletionStatusEx( port, entries, 2, &count, 0, TRUE ); ok(!ret || broken(ret) /* Vista */, "GetQueuedCompletionStatusEx succeeded\n"); if (!ret) ok(GetLastError() == WAIT_IO_COMPLETION, "wrong error %lu\n", GetLastError()); - ok(count == 1, "wrong count %lu\n", count); + ok(count <= 1, "wrong count %lu\n", count); ok(user_apc_ran, "user APC should have run\n"); user_apc_ran = FALSE;
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
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