Commit 45f61965 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmusic: Implement synth port IDirectMusicPortDownload_GetDLId.

parent 77074949
......@@ -40,6 +40,8 @@ struct synth_port {
DMUS_PORTPARAMS params;
int nrofgroups;
DMUSIC_PRIVATE_CHANNEL_GROUP group[1];
DWORD next_dlid;
};
static inline IDirectMusicDownloadedInstrumentImpl* impl_from_IDirectMusicDownloadedInstrument(IDirectMusicDownloadedInstrument *iface)
......@@ -595,11 +597,17 @@ static HRESULT WINAPI synth_port_download_AllocateBuffer(IDirectMusicPortDownloa
return S_OK;
}
static HRESULT WINAPI synth_port_download_GetDLId(IDirectMusicPortDownload *iface, DWORD *start_DLId, DWORD count)
static HRESULT WINAPI synth_port_download_GetDLId(IDirectMusicPortDownload *iface, DWORD *first, DWORD count)
{
struct synth_port *This = synth_from_IDirectMusicPortDownload(iface);
FIXME("(%p/%p, %p, %lu): stub\n", iface, This, start_DLId, count);
TRACE("(%p/%p, %p, %lu)\n", iface, This, first, count);
if (!first) return E_POINTER;
if (!count) return E_INVALIDARG;
*first = This->next_dlid;
This->next_dlid += count;
return S_OK;
}
......
......@@ -1081,14 +1081,14 @@ static void test_port_download(void)
/* GetDLId allocates the given number of slots and returns only the first */
hr = IDirectMusicPortDownload_GetDLId(port, NULL, 0);
todo_wine ok(hr == E_POINTER, "got %#lx\n", hr);
ok(hr == E_POINTER, "got %#lx\n", hr);
hr = IDirectMusicPortDownload_GetDLId(port, ids, 0);
todo_wine ok(hr == E_INVALIDARG, "got %#lx\n", hr);
ok(hr == E_INVALIDARG, "got %#lx\n", hr);
memset(ids, 0xcc, sizeof(ids));
hr = IDirectMusicPortDownload_GetDLId(port, ids, 4);
ok(hr == S_OK, "got %#lx\n", hr);
todo_wine ok(ids[0] == 0, "got %#lx\n", ids[0]);
ok(ids[0] == 0, "got %#lx\n", ids[0]);
ok(ids[1] == 0xcccccccc, "got %#lx\n", ids[1]);
/* GetBuffer looks up allocated ids to find downloaded buffers */
......@@ -1168,7 +1168,7 @@ static void test_port_download(void)
/* DLIds are never released */
hr = IDirectMusicPortDownload_GetDLId(port, ids, 1);
ok(hr == S_OK, "got %#lx\n", hr);
todo_wine ok(ids[0] == 4, "got %#lx\n", ids[0]);
ok(ids[0] == 4, "got %#lx\n", ids[0]);
IDirectMusicDownload_Release(download);
......
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