From: Alistair Leslie-Hughes Subject: [PATCH] xactengine3_7: Explicity copy the XACT_RUNTIME_PARAMETERS members Message-Id: Date: Wed, 30 Sep 2020 16:51:24 +1000 Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=49911 Signed-off-by: Alistair Leslie-Hughes --- dlls/xactengine3_7/xact_dll.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/dlls/xactengine3_7/xact_dll.c b/dlls/xactengine3_7/xact_dll.c index e6e4dbb7b35..09e7871c171 100644 --- a/dlls/xactengine3_7/xact_dll.c +++ b/dlls/xactengine3_7/xact_dll.c @@ -780,7 +780,16 @@ static HRESULT WINAPI IXACT3EngineImpl_Initialize(IXACT3Engine *iface, TRACE("(%p)->(%p)\n", This, pParams); - memcpy(¶ms, pParams, sizeof(FACTRuntimeParameters)); + memset(¶ms, 0, sizeof(FACTRuntimeParameters)); + /* Explicitly copy to the FAudio structure as the packing is wrong when using 64 bits */ + params.lookAheadTime = pParams->lookAheadTime; + params.pGlobalSettingsBuffer = pParams->pGlobalSettingsBuffer; + params.globalSettingsBufferSize = pParams->globalSettingsBufferSize; + params.globalSettingsFlags = pParams->globalSettingsFlags; + params.globalSettingsAllocAttributes = pParams->globalSettingsAllocAttributes; + params.pRendererID = (int16_t*)pParams->pRendererID; + params.pXAudio2 = NULL; + params.pMasteringVoice = NULL; /* FIXME: pXAudio2 and pMasteringVoice are pointers to * IXAudio2/IXAudio2MasteringVoice objects. FACT wants pointers to @@ -793,12 +802,10 @@ static HRESULT WINAPI IXACT3EngineImpl_Initialize(IXACT3Engine *iface, * -flibit */ if (pParams->pXAudio2 != NULL){ - FIXME("pXAudio2 parameter not supported! Falling back to NULL\n"); - params.pXAudio2 = NULL; + FIXME("pXAudio2 parameter not supported!\n"); if (pParams->pMasteringVoice != NULL){ - FIXME("pXAudio2 parameter not supported! Falling back to NULL\n"); - params.pMasteringVoice = NULL; + FIXME("pXAudio2 parameter not supported!\n"); } } -- 2.28.0