Random DirectSound Crashes after Switching user or sleep/hibernate



I've got a couple of threads running that are acquiring and playing data.

however, if I use fast user switching on vista, and log into a different account, and then log back into the account with my program running, it will occasionally (but not everytime) crash when calling Unlock on the playback buffer.

It has also crashed when calling GetCurrentPosition( &dwCapturePos, &dwReadPos ) on the Capture buffer.

The crash is within DSOUND.DLL, and I don't get any failure codes (it seems) from any calls before that.

What's the recommended action to take to avoid this?

Anthony Wieser
Wieser Software Ltd



.