dmusic: IDirectMusicBufferImpl_GetUsedBytes.

This commit is contained in:
Christian Costa 2012-04-26 08:08:43 +02:00 committed by Alexandre Julliard
parent fbd0aba739
commit 5c5ed245aa
2 changed files with 11 additions and 2 deletions

View File

@ -177,11 +177,16 @@ static HRESULT WINAPI IDirectMusicBufferImpl_GetStartTime(LPDIRECTMUSICBUFFER if
return S_OK;
}
static HRESULT WINAPI IDirectMusicBufferImpl_GetUsedBytes(LPDIRECTMUSICBUFFER iface, LPDWORD pcb)
static HRESULT WINAPI IDirectMusicBufferImpl_GetUsedBytes(LPDIRECTMUSICBUFFER iface, LPDWORD used_bytes)
{
IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface);
FIXME("(%p, %p): stub\n", This, pcb);
TRACE("(%p)->(%p)\n", iface, used_bytes);
if (!used_bytes)
return E_POINTER;
*used_bytes = This->write_pos;
return S_OK;
}

View File

@ -112,6 +112,7 @@ static void test_dmbuffer(void)
DMUS_BUFFERDESC desc;
GUID format;
DWORD size;
DWORD bytes;
hr = CoCreateInstance(&CLSID_DirectMusic, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectMusic, (LPVOID*)&dmusic);
if (hr != S_OK)
@ -139,6 +140,9 @@ static void test_dmbuffer(void)
ok(hr == DMUS_E_INVALID_EVENT, "IDirectMusicBuffer_PackStructured returned %x\n", hr);
hr = IDirectMusicBuffer_PackStructured(dmbuffer, 10, 0, 0x000090); /* note on : chan 0, note 0 & vel 0 */
ok(hr == S_OK, "IDirectMusicBuffer_PackStructured returned %x\n", hr);
hr = IDirectMusicBuffer_GetUsedBytes(dmbuffer, &bytes);
ok(hr == S_OK, "IDirectMusicBuffer_GetUsedBytes returned %x\n", hr);
ok(bytes == 24, "Buffer size is %u instead of 0\n", bytes);
if (dmbuffer)
IDirectMusicBuffer_Release(dmbuffer);