From bd135b1477fa9ea5e7aa374c43dbc9ca5a8808e0 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 28 Jan 2021 13:24:47 +1100 Subject: [PATCH] Updated xactengine3_7-Notification patchset --- patches/patchinstall.sh | 1 + ...-Record-context-for-each-notications.patch | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 patches/xactengine3_7-Notification/0002-xactengine3_7-Record-context-for-each-notications.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 87df8f26..4822c4ba 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -5257,6 +5257,7 @@ fi # | if test "$enable_xactengine3_7_Notification" -eq 1; then patch_apply xactengine3_7-Notification/0001-xactengine3.7-Delay-Notication-for-WAVEBANKPREPARED.patch + patch_apply xactengine3_7-Notification/0002-xactengine3_7-Record-context-for-each-notications.patch fi # Patchset xactengine3_7-PrepareWave diff --git a/patches/xactengine3_7-Notification/0002-xactengine3_7-Record-context-for-each-notications.patch b/patches/xactengine3_7-Notification/0002-xactengine3_7-Record-context-for-each-notications.patch new file mode 100644 index 00000000..09a54e1a --- /dev/null +++ b/patches/xactengine3_7-Notification/0002-xactengine3_7-Record-context-for-each-notications.patch @@ -0,0 +1,58 @@ +From 0b8b06c2e94d23e9f6f8614073450c5598830c7d Mon Sep 17 00:00:00 2001 +From: Alistair Leslie-Hughes +Date: Thu, 28 Jan 2021 12:29:42 +1100 +Subject: [PATCH] xactengine3_7: Record context for each notications + +This helps the first lockup but starting a game causes another freeze. + +Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49678 +--- + dlls/xactengine3_7/xact_dll.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c +index c3c6b785094..1eda7661acc 100644 +--- a/dlls/xactengine3_7/xact_dll.c ++++ b/dlls/xactengine3_7/xact_dll.c +@@ -637,6 +637,8 @@ typedef struct _XACT3EngineImpl { + XACT_READFILE_CALLBACK pReadFile; + XACT_GETOVERLAPPEDRESULT_CALLBACK pGetOverlappedResult; + XACT_NOTIFICATION_CALLBACK notification_callback; ++ ++ void *contexts[17]; + } XACT3EngineImpl; + + typedef struct wrap_readfile_struct { +@@ -990,6 +992,7 @@ static HRESULT WINAPI IXACT3EngineImpl_CreateStreamingWaveBank(IXACT3Engine *ifa + + tdata->engine = This; + tdata->note.type = XACTNOTIFICATIONTYPE_WAVEBANKPREPARED; ++ tdata->note.pvContext = This->contexts[tdata->note.type - 1]; + tdata->note.u.wave.pWaveBank = &wb->IXACT3WaveBank_iface; + + thread = CreateThread(NULL, 0, thread_notications, tdata, 0, NULL); +@@ -1239,9 +1242,11 @@ static HRESULT WINAPI IXACT3EngineImpl_RegisterNotification(IXACT3Engine *iface, + XACT3EngineImpl *This = impl_from_IXACT3Engine(iface); + FACTNotificationDescription fdesc; + +- TRACE("(%p)->(%p)\n", This, pNotificationDesc); ++ TRACE("(%p)->(%p, pvContext %p)\n", This, pNotificationDesc, pNotificationDesc->pvContext); + + unwrap_notificationdesc(&fdesc, pNotificationDesc); ++ ++ This->contexts[pNotificationDesc->type - 1] = pNotificationDesc->pvContext; + fdesc.pvContext = This; + return FACTAudioEngine_RegisterNotification(This->fact_engine, &fdesc); + } +@@ -1255,6 +1260,8 @@ static HRESULT WINAPI IXACT3EngineImpl_UnRegisterNotification(IXACT3Engine *ifac + TRACE("(%p)->(%p)\n", This, pNotificationDesc); + + unwrap_notificationdesc(&fdesc, pNotificationDesc); ++ ++ This->contexts[pNotificationDesc->type - 1] = pNotificationDesc->pvContext; + fdesc.pvContext = This; + return FACTAudioEngine_UnRegisterNotification(This->fact_engine, &fdesc); + } +-- +2.29.2 +