dsound: Hold lock in GetStatus.

This commit is contained in:
Maarten Lankhorst 2008-04-02 15:01:27 -07:00 committed by Alexandre Julliard
parent 3f9209eb2a
commit 98933362f3

View File

@ -465,11 +465,13 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetStatus(
}
*status = 0;
RtlAcquireResourceShared(&This->lock, TRUE);
if ((This->state == STATE_STARTING) || (This->state == STATE_PLAYING)) {
*status |= DSBSTATUS_PLAYING;
if (This->playflags & DSBPLAY_LOOPING)
*status |= DSBSTATUS_LOOPING;
}
RtlReleaseResource(&This->lock);
TRACE("status=%x\n", *status);
return DS_OK;