winecoreaudio: Make wodReset fail if called on a closed device.

This commit is contained in:
Ken Thomases 2007-06-20 07:01:11 -05:00 committed by Alexandre Julliard
parent ed10114b12
commit 4906ffaa5b
1 changed files with 8 additions and 1 deletions

View File

@ -1279,6 +1279,13 @@ static DWORD wodReset(WORD wDevID)
OSSpinLockLock(&wwo->lock); OSSpinLockLock(&wwo->lock);
if (wwo->state == WINE_WS_CLOSED)
{
OSSpinLockUnlock(&wwo->lock);
WARN("resetting a closed device\n");
return MMSYSERR_INVALHANDLE;
}
lpSavedQueuePtr = wwo->lpQueuePtr; lpSavedQueuePtr = wwo->lpQueuePtr;
wwo->lpPlayPtr = wwo->lpQueuePtr = wwo->lpLoopPtr = NULL; wwo->lpPlayPtr = wwo->lpQueuePtr = wwo->lpLoopPtr = NULL;
wwo->state = WINE_WS_STOPPED; wwo->state = WINE_WS_STOPPED;