Commit 55b48ff6 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

mmdevapi: Implement IMMDeviceEnumerator::GetDevice.

parent d53dc08e
......@@ -809,9 +809,31 @@ static HRESULT WINAPI MMDevEnum_GetDefaultAudioEndpoint(IMMDeviceEnumerator *ifa
static HRESULT WINAPI MMDevEnum_GetDevice(IMMDeviceEnumerator *iface, const WCHAR *name, IMMDevice **device)
{
MMDevEnumImpl *This = (MMDevEnumImpl*)iface;
DWORD i=0;
IMMDevice *dev = NULL;
TRACE("(%p)->(%s,%p)\n", This, debugstr_w(name), device);
FIXME("stub\n");
return E_NOTIMPL;
for (i = 0; i < MMDevice_count; ++i)
{
WCHAR *str;
dev = (IMMDevice*)MMDevice_head[i];
IMMDevice_GetId(dev, &str);
if (str && !lstrcmpW(str, name))
{
CoTaskMemFree(str);
break;
}
CoTaskMemFree(str);
}
if (dev)
{
IUnknown_AddRef(dev);
*device = dev;
return S_OK;
}
WARN("Could not find device %s\n", debugstr_w(name));
return E_NOTFOUND;
}
static HRESULT WINAPI MMDevEnum_RegisterEndpointNotificationCallback(IMMDeviceEnumerator *iface, IMMNotificationClient *client)
......
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