dsound: Lock the source buffer during duplication.

oldstable
Andrew Eikum 2012-01-16 14:02:45 -06:00 committed by Alexandre Julliard
parent ab73506528
commit 9cf7f95483
1 changed files with 6 additions and 0 deletions

View File

@ -1083,9 +1083,15 @@ HRESULT IDirectSoundBufferImpl_Duplicate(
*ppdsb = NULL;
return DSERR_OUTOFMEMORY;
}
RtlAcquireResourceShared(&pdsb->lock, TRUE);
CopyMemory(dsb, pdsb, sizeof(*dsb));
dsb->pwfx = DSOUND_CopyFormat(pdsb->pwfx);
RtlReleaseResource(&pdsb->lock);
if (dsb->pwfx == NULL) {
HeapFree(GetProcessHeap(),0,dsb);
*ppdsb = NULL;