I ran into some problems testing the BASS library in Lazarus pascal, because BASS_ChannelGetData returns a result in DWORD format, but the documentation says that in case of errors, the result is -1.
Now, DWORD (at least in Pascal) is an unsigned number, and cannot be -1.
Therefore if I read the result of BASS_ChannelGetData with a DWORD variable, and check for a -1 result, I will never get it!
I solved it by using a signed integer, instead of DWORD, to store the result of the BASS_ChannelGetData call. Alternatively, I check that the unsigned returned number of bytes/samples is within the expected range.
Anyway, problem solved for me, but I thought to let everyone know about this situation. Something similar may also happen with other functions that return DWORD and represent errors with -1