Huw Davies (@huw) commented about dlls/dsound/capture.c:
if (This->device->client) { *lplpvAudioPtr1 = This->device->buffer + dwReadCusor; - if ( (dwReadCusor + dwReadBytes) > This->device->buflen) { - *lpdwAudioBytes1 = This->device->buflen - dwReadCusor; + if ( dwReadCusor > This->device->buflen || This->device->buflen - dwReadCusor < dwReadBytes) { + *lpdwAudioBytes1 = 0; + *lplpvAudioPtr1 = NULL; if (lplpvAudioPtr2) - *lplpvAudioPtr2 = This->device->buffer; + *lplpvAudioPtr2 = NULL; if (lpdwAudioBytes2) - *lpdwAudioBytes2 = dwReadBytes - *lpdwAudioBytes1; + *lpdwAudioBytes2 = 0; + hres = DSERR_INVALIDPARAM; } else { *lpdwAudioBytes1 = dwReadBytes;
Could you remove the remaining tabs from this block? It's already somewhat of a mix and your changes make the indentation look very odd on when displayed using 8-space tabs. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10966#note_140931