From 19cb2d2171ceeb5a5cb71501e4172d64fb67c8fc Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Mon, 14 May 2012 08:06:39 +0200 Subject: [PATCH] dmusic: Implement IDirectMusicBuffer_SetUsedBytes. --- dlls/dmusic/buffer.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c index 2fd76b5c368..35cbd88d765 100644 --- a/dlls/dmusic/buffer.c +++ b/dlls/dmusic/buffer.c @@ -1,6 +1,8 @@ -/* IDirectMusicBuffer Implementation +/* + * IDirectMusicBuffer Implementation * * Copyright (C) 2003-2004 Rok Mandeljc + * Copyright (C) 2012 Christian Costa * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -241,11 +243,16 @@ static HRESULT WINAPI IDirectMusicBufferImpl_SetStartTime(LPDIRECTMUSICBUFFER if return S_OK; } -static HRESULT WINAPI IDirectMusicBufferImpl_SetUsedBytes (LPDIRECTMUSICBUFFER iface, DWORD cb) +static HRESULT WINAPI IDirectMusicBufferImpl_SetUsedBytes(LPDIRECTMUSICBUFFER iface, DWORD used_bytes) { IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface); - FIXME("(%p, %d): stub\n", This, cb); + TRACE("(%p)->(%u)\n", iface, used_bytes); + + if (used_bytes > This->size) + return DMUS_E_BUFFER_FULL; + + This->write_pos = used_bytes; return S_OK; } -- 2.11.4.GIT