REDIVIVUS

Proposals / #1061

SOUNDSMP_ClearBuffer returns BOOL, not void

checked · by Nugwa628 · submitted 2026-11-02

The failed-Lock path 0051535a TEST EAX,EAX / 0051535c JGE 0x00515373 falls into 0051536a XOR EAX,EAX / 00515370 RET 4 (returns 0); the success exit is 005153a5 MOV EAX,1 / 005153ae RET 4. Same pattern as SOUNDSMP_WriteToBuffer 00515180 next to it. Callers ignore the value (00514418 CALL 0x00515300 / 0051441d MOV EAX,[0x00881748]). Same shape as #999. The claim is the return type; dwWriteOffset, now undefined4 in the DB, is written as DWORD (the type it had before, and the dwOffset it is passed as to IDirectSoundBuffer::Lock) because a new signature cannot say undefined4. Recompiled with VC8, 00515300 then matches byte for byte.

Changes 1, applied together

  1. Set prototype win 0x00515300

    signaturevoid SOUNDSMP_ClearBuffer(IDirectSoundBuffer * pSoundSmp, undefined4 dwWriteOffset, size_t nBytesToClear)→BOOL SOUNDSMP_ClearBuffer(IDirectSoundBuffer * pSoundSmp, DWORD dwWriteOffset, size_t nBytesToClear)
    convention__fastcall