Module: wine Branch: master Commit: 55b48ff66299a07d41756c1b199806846d4fc415 URL: http://source.winehq.org/git/wine.git/?a=commit;h=55b48ff66299a07d41756c1b19...
Author: Maarten Lankhorst m.b.lankhorst@gmail.com Date: Sun Feb 21 14:26:43 2010 +0100
mmdevapi: Implement IMMDeviceEnumerator::GetDevice.
---
dlls/mmdevapi/devenum.c | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c index cbe4ab0..f39fe97 100644 --- a/dlls/mmdevapi/devenum.c +++ b/dlls/mmdevapi/devenum.c @@ -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)