Unfortunately in this world there is no ideal complex software, and sometimes this is very sad. I spent few hours to find what is wrong with my code and finally... I found some stupid bug in sound drivers for ASUS Xonar DS on Windows. In some cases my code tries to Lock zero bytes for IDirectSoundBuffer, and considering the documentation - it's fine and I should get some error as a result instead of DS_OK. But with some configuration(with disabled "gx mode" for that sound card) I get only a crash. So, be careful and don't try to pass zero to Lock method, because some developers don't know what is standards...