Commit 336cc787 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mmdevapi: Return interface pointers instead of impl pointers.

parent f0c50866
...@@ -40,8 +40,6 @@ ...@@ -40,8 +40,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi); WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi);
static const IAudioEndpointVolumeExVtbl AEVImpl_Vtbl;
typedef struct AEVImpl { typedef struct AEVImpl {
IAudioEndpointVolumeEx IAudioEndpointVolumeEx_iface; IAudioEndpointVolumeEx IAudioEndpointVolumeEx_iface;
LONG ref; LONG ref;
...@@ -52,18 +50,6 @@ static inline AEVImpl *impl_from_IAudioEndpointVolumeEx(IAudioEndpointVolumeEx * ...@@ -52,18 +50,6 @@ static inline AEVImpl *impl_from_IAudioEndpointVolumeEx(IAudioEndpointVolumeEx *
return CONTAINING_RECORD(iface, AEVImpl, IAudioEndpointVolumeEx_iface); return CONTAINING_RECORD(iface, AEVImpl, IAudioEndpointVolumeEx_iface);
} }
HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolume **ppv)
{
AEVImpl *This;
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This));
*ppv = (IAudioEndpointVolume*)This;
if (!This)
return E_OUTOFMEMORY;
This->IAudioEndpointVolumeEx_iface.lpVtbl = &AEVImpl_Vtbl;
This->ref = 1;
return S_OK;
}
static void AudioEndpointVolume_Destroy(AEVImpl *This) static void AudioEndpointVolume_Destroy(AEVImpl *This)
{ {
HeapFree(GetProcessHeap(), 0, This); HeapFree(GetProcessHeap(), 0, This);
...@@ -79,7 +65,7 @@ static HRESULT WINAPI AEV_QueryInterface(IAudioEndpointVolumeEx *iface, REFIID r ...@@ -79,7 +65,7 @@ static HRESULT WINAPI AEV_QueryInterface(IAudioEndpointVolumeEx *iface, REFIID r
if (IsEqualIID(riid, &IID_IUnknown) || if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IAudioEndpointVolume) || IsEqualIID(riid, &IID_IAudioEndpointVolume) ||
IsEqualIID(riid, &IID_IAudioEndpointVolumeEx)) { IsEqualIID(riid, &IID_IAudioEndpointVolumeEx)) {
*ppv = This; *ppv = &This->IAudioEndpointVolumeEx_iface;
} }
else else
return E_NOINTERFACE; return E_NOINTERFACE;
...@@ -286,3 +272,18 @@ static const IAudioEndpointVolumeExVtbl AEVImpl_Vtbl = { ...@@ -286,3 +272,18 @@ static const IAudioEndpointVolumeExVtbl AEVImpl_Vtbl = {
AEV_GetVolumeRange, AEV_GetVolumeRange,
AEV_GetVolumeRangeChannel AEV_GetVolumeRangeChannel
}; };
HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolume **ppv)
{
AEVImpl *This;
*ppv = NULL;
This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
if (!This)
return E_OUTOFMEMORY;
This->IAudioEndpointVolumeEx_iface.lpVtbl = &AEVImpl_Vtbl;
This->ref = 1;
*ppv = (IAudioEndpointVolume*)&This->IAudioEndpointVolumeEx_iface;
return S_OK;
}
...@@ -551,7 +551,7 @@ static HRESULT WINAPI MMDevice_QueryInterface(IMMDevice *iface, REFIID riid, voi ...@@ -551,7 +551,7 @@ static HRESULT WINAPI MMDevice_QueryInterface(IMMDevice *iface, REFIID riid, voi
*ppv = NULL; *ppv = NULL;
if (IsEqualIID(riid, &IID_IUnknown) if (IsEqualIID(riid, &IID_IUnknown)
|| IsEqualIID(riid, &IID_IMMDevice)) || IsEqualIID(riid, &IID_IMMDevice))
*ppv = This; *ppv = &This->IMMDevice_iface;
else if (IsEqualIID(riid, &IID_IMMEndpoint)) else if (IsEqualIID(riid, &IID_IMMEndpoint))
*ppv = &This->IMMEndpoint_iface; *ppv = &This->IMMEndpoint_iface;
if (*ppv) if (*ppv)
...@@ -797,7 +797,7 @@ static HRESULT WINAPI MMDevCol_QueryInterface(IMMDeviceCollection *iface, REFIID ...@@ -797,7 +797,7 @@ static HRESULT WINAPI MMDevCol_QueryInterface(IMMDeviceCollection *iface, REFIID
return E_POINTER; return E_POINTER;
if (IsEqualIID(riid, &IID_IUnknown) if (IsEqualIID(riid, &IID_IUnknown)
|| IsEqualIID(riid, &IID_IMMDeviceCollection)) || IsEqualIID(riid, &IID_IMMDeviceCollection))
*ppv = This; *ppv = &This->IMMDeviceCollection_iface;
else else
*ppv = NULL; *ppv = NULL;
if (!*ppv) if (!*ppv)
...@@ -897,7 +897,7 @@ HRESULT MMDevEnum_Create(REFIID riid, void **ppv) ...@@ -897,7 +897,7 @@ HRESULT MMDevEnum_Create(REFIID riid, void **ppv)
load_driver_devices(eRender); load_driver_devices(eRender);
load_driver_devices(eCapture); load_driver_devices(eCapture);
} }
return IUnknown_QueryInterface((IUnknown*)This, riid, ppv); return IMMDeviceEnumerator_QueryInterface(&This->IMMDeviceEnumerator_iface, riid, ppv);
} }
void MMDevEnum_Free(void) void MMDevEnum_Free(void)
...@@ -920,7 +920,7 @@ static HRESULT WINAPI MMDevEnum_QueryInterface(IMMDeviceEnumerator *iface, REFII ...@@ -920,7 +920,7 @@ static HRESULT WINAPI MMDevEnum_QueryInterface(IMMDeviceEnumerator *iface, REFII
return E_POINTER; return E_POINTER;
if (IsEqualIID(riid, &IID_IUnknown) if (IsEqualIID(riid, &IID_IUnknown)
|| IsEqualIID(riid, &IID_IMMDeviceEnumerator)) || IsEqualIID(riid, &IID_IMMDeviceEnumerator))
*ppv = This; *ppv = &This->IMMDeviceEnumerator_iface;
else else
*ppv = NULL; *ppv = NULL;
if (!*ppv) if (!*ppv)
...@@ -1345,7 +1345,7 @@ static HRESULT WINAPI MMDevPropStore_QueryInterface(IPropertyStore *iface, REFII ...@@ -1345,7 +1345,7 @@ static HRESULT WINAPI MMDevPropStore_QueryInterface(IPropertyStore *iface, REFII
return E_POINTER; return E_POINTER;
if (IsEqualIID(riid, &IID_IUnknown) if (IsEqualIID(riid, &IID_IUnknown)
|| IsEqualIID(riid, &IID_IPropertyStore)) || IsEqualIID(riid, &IID_IPropertyStore))
*ppv = This; *ppv = &This->IPropertyStore_iface;
else else
*ppv = NULL; *ppv = NULL;
if (!*ppv) if (!*ppv)
......
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