Skip to content

Commit

Permalink
Fixup for return value tests in XACT fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CookiePLMonster committed Mar 7, 2020
1 parent 858bc77 commit 0bd9002
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SilentPatchBully/SilentPatchBully.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ namespace SEALeaksFix
}

static inline DWORD (*MDXactCreateSoundBankCommand)(DWORD, DWORD, DWORD, DWORD);
DWORD MDXactCreateSoundBankWithManagedDataCommand(DWORD buffer, DWORD size, DWORD flags, DWORD alloc_attributes)
DWORD MDXactCreateSoundBankWithManagedDataCommand(DWORD buffer, DWORD size, DWORD /*flags*/, DWORD alloc_attributes)
{
return MDXactCreateSoundBankCommand(buffer, size, 1 /*XACT_FLAG_ENGINE_CREATE_MANAGEDATA*/, alloc_attributes);
}
Expand All @@ -370,8 +370,8 @@ namespace SEALeaksFix

DWORD pfnCreateInMemoryWaveBank = *(DWORD*)(*(DWORD*)pXactEngine + 0x28);
DWORD pXactWaveBank = NULL;
if((*(HRESULT (__stdcall *)(DWORD, LPVOID, DWORD, DWORD, DWORD, PDWORD))pfnCreateInMemoryWaveBank)(
pXactEngine, buffer, size, flags, alloc_attributes, &pXactWaveBank) == S_OK)
if(SUCCEEDED((*(HRESULT (__stdcall *)(DWORD, LPVOID, DWORD, DWORD, DWORD, PDWORD))pfnCreateInMemoryWaveBank)(
pXactEngine, buffer, size, flags, alloc_attributes, &pXactWaveBank)))
{
(*(void (__cdecl *)(DWORD))0x5AD810)(pXactWaveBank); // register ref counted wave bank
(*(void (__cdecl *)(int))0x5AD4D0)(id);
Expand Down Expand Up @@ -409,8 +409,8 @@ namespace SEALeaksFix

DWORD pfnCreateSoundBank = *(DWORD*)(*(DWORD*)pXactEngine + 0x24);
DWORD pXactSoundBank = NULL;
if((*(HRESULT (__stdcall *)(DWORD, LPVOID, DWORD, DWORD, DWORD, PDWORD))pfnCreateSoundBank)(
pXactEngine, buffer, size, flags, alloc_attributes, &pXactSoundBank) == S_OK)
if(SUCCEEDED((*(HRESULT (__stdcall *)(DWORD, LPVOID, DWORD, DWORD, DWORD, PDWORD))pfnCreateSoundBank)(
pXactEngine, buffer, size, flags, alloc_attributes, &pXactSoundBank)))
{
(*(void (__cdecl *)(DWORD))0x5AD8E0)(pXactSoundBank); // register ref counted sound bank
(*(void (__cdecl *)(int))0x5AD530)(id);
Expand Down

0 comments on commit 0bd9002

Please sign in to comment.