Commit 58ea6abe authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winecoreaudio: Implement widAddBuffer.

parent 5432adaa
......@@ -1666,6 +1666,9 @@ static DWORD widClose(WORD wDevID)
*/
static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
{
DWORD ret = MMSYSERR_NOERROR;
WINE_WAVEIN* wwi;
TRACE("(%u, %p, %08X);\n", wDevID, lpWaveHdr, dwSize);
if (wDevID >= MAX_WAVEINDRV)
......@@ -1684,8 +1687,32 @@ static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
return WAVERR_STILLPLAYING;
}
FIXME("unimplemented\n");
return MMSYSERR_NOTENABLED;
wwi = &WInDev[wDevID];
OSSpinLockLock(&wwi->lock);
if (wwi->state == WINE_WS_CLOSED)
{
WARN("Trying to add buffer to closed device.\n");
ret = MMSYSERR_INVALHANDLE;
}
else
{
LPWAVEHDR* wh;
lpWaveHdr->dwFlags |= WHDR_INQUEUE;
lpWaveHdr->dwFlags &= ~WHDR_DONE;
lpWaveHdr->dwBytesRecorded = 0;
lpWaveHdr->lpNext = NULL;
/* insert buffer at end of queue */
for (wh = &(wwi->lpQueuePtr); *wh; wh = &((*wh)->lpNext))
/* Do nothing */;
*wh = lpWaveHdr;
}
OSSpinLockUnlock(&wwi->lock);
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment