-- v4: winepulse: Remove AudioSessionManager. wineoss: Remove AudioSessionManager. winecoreaudio: Remove AudioSessionManager. winealsa: Remove AudioSessionManager. mmdevapi: Switch to own AudioSessionManager. mmdevapi: Implement AudioSessionManager. mmdevapi: Import GetAudioSessionWrapper() from driver. winepulse: Export function to get AudioSessionWrapper object. wineoss: Export function to get AudioSessionWrapper object. winecoreaudio: Export function to get AudioSessionWrapper object. winealsa: Export function to get AudioSessionWrapper object.
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/winealsa.drv/mmdevdrv.c | 18 ++++++++++++++++++ dlls/winealsa.drv/winealsa.drv.spec | 1 + 2 files changed, 19 insertions(+)
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 09123a64311..185ae42e520 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -2378,6 +2378,24 @@ HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, return S_OK; }
+HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, + AudioSessionWrapper **out) +{ + AudioSession *session; + + HRESULT hr = get_audio_session(guid, device, 0, &session); + if(FAILED(hr)) + return hr; + + *out = AudioSessionWrapper_Create(NULL); + if(!*out) + return E_OUTOFMEMORY; + + (*out)->session = session; + + return S_OK; +} + HRESULT WINAPI AUDDRV_GetPropValue(GUID *guid, const PROPERTYKEY *prop, PROPVARIANT *out) { struct get_prop_value_params params; diff --git a/dlls/winealsa.drv/winealsa.drv.spec b/dlls/winealsa.drv/winealsa.drv.spec index d846ade8ce2..c1f999ed0bd 100644 --- a/dlls/winealsa.drv/winealsa.drv.spec +++ b/dlls/winealsa.drv/winealsa.drv.spec @@ -7,4 +7,5 @@ @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint @ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager +@ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper @ stdcall -private GetPropValue(ptr ptr ptr) AUDDRV_GetPropValue
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/winecoreaudio.drv/mmdevdrv.c | 18 ++++++++++++++++++ dlls/winecoreaudio.drv/winecoreaudio.drv.spec | 1 + 2 files changed, 19 insertions(+)
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 2fea175df63..06f74e6416a 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -2325,3 +2325,21 @@ HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device,
return S_OK; } + +HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, + AudioSessionWrapper **out) +{ + AudioSession *session; + + HRESULT hr = get_audio_session(guid, device, 0, &session); + if(FAILED(hr)) + return hr; + + *out = AudioSessionWrapper_Create(NULL); + if(!*out) + return E_OUTOFMEMORY; + + (*out)->session = session; + + return S_OK; +} diff --git a/dlls/winecoreaudio.drv/winecoreaudio.drv.spec b/dlls/winecoreaudio.drv/winecoreaudio.drv.spec index 1dfbfb79eb9..9b2200afb34 100644 --- a/dlls/winecoreaudio.drv/winecoreaudio.drv.spec +++ b/dlls/winecoreaudio.drv/winecoreaudio.drv.spec @@ -7,3 +7,4 @@ @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint @ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager +@ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/wineoss.drv/mmdevdrv.c | 18 ++++++++++++++++++ dlls/wineoss.drv/wineoss.drv.spec | 1 + 2 files changed, 19 insertions(+)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 631f4571aa7..70324ab805c 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -2321,3 +2321,21 @@ HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device,
return S_OK; } + +HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, + AudioSessionWrapper **out) +{ + AudioSession *session; + + HRESULT hr = get_audio_session(guid, device, 0, &session); + if(FAILED(hr)) + return hr; + + *out = AudioSessionWrapper_Create(NULL); + if(!*out) + return E_OUTOFMEMORY; + + (*out)->session = session; + + return S_OK; +} diff --git a/dlls/wineoss.drv/wineoss.drv.spec b/dlls/wineoss.drv/wineoss.drv.spec index a093649e982..a5da6bcc532 100644 --- a/dlls/wineoss.drv/wineoss.drv.spec +++ b/dlls/wineoss.drv/wineoss.drv.spec @@ -8,3 +8,4 @@ @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint @ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager +@ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/winepulse.drv/mmdevdrv.c | 18 ++++++++++++++++++ dlls/winepulse.drv/winepulse.drv.spec | 1 + 2 files changed, 19 insertions(+)
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 63f111dde46..b1c44fe56d5 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -2580,6 +2580,24 @@ HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, return S_OK; }
+HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, + AudioSessionWrapper **out) +{ + AudioSession *session; + + HRESULT hr = get_audio_session(guid, device, 0, &session); + if(FAILED(hr)) + return hr; + + *out = AudioSessionWrapper_Create(NULL); + if(!*out) + return E_OUTOFMEMORY; + + (*out)->session = session; + + return S_OK; +} + HRESULT WINAPI AUDDRV_GetPropValue(GUID *guid, const PROPERTYKEY *prop, PROPVARIANT *out) { struct get_prop_value_params params; diff --git a/dlls/winepulse.drv/winepulse.drv.spec b/dlls/winepulse.drv/winepulse.drv.spec index b822fd08353..02a14aabf7a 100644 --- a/dlls/winepulse.drv/winepulse.drv.spec +++ b/dlls/winepulse.drv/winepulse.drv.spec @@ -2,6 +2,7 @@ @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint @ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager +@ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper @ stdcall -private GetPropValue(ptr ptr ptr) AUDDRV_GetPropValue
# WinMM driver functions
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/mmdevapi/main.c | 1 + dlls/mmdevapi/mmdevapi_private.h | 3 +++ 2 files changed, 4 insertions(+)
diff --git a/dlls/mmdevapi/main.c b/dlls/mmdevapi/main.c index f1bbcc7fc3f..80c5e60880c 100644 --- a/dlls/mmdevapi/main.c +++ b/dlls/mmdevapi/main.c @@ -101,6 +101,7 @@ static BOOL load_driver(const WCHAR *name, DriverFuncs *driver) LDFC(GetEndpointIDs); LDFC(GetAudioEndpoint); LDFC(GetAudioSessionManager); + LDFC(GetAudioSessionWrapper); #undef LDFC
/* optional - do not fail if not found */ diff --git a/dlls/mmdevapi/mmdevapi_private.h b/dlls/mmdevapi/mmdevapi_private.h index a468890dffd..a61375869ee 100644 --- a/dlls/mmdevapi/mmdevapi_private.h +++ b/dlls/mmdevapi/mmdevapi_private.h @@ -23,6 +23,7 @@ #include <wine/list.h> #include <wine/unixlib.h>
+#include "mmdevdrv.h" #include "unixlib.h"
extern HRESULT MMDevEnum_Create(REFIID riid, void **ppv) DECLSPEC_HIDDEN; @@ -50,6 +51,8 @@ typedef struct _DriverFuncs { IAudioClient **out); HRESULT (WINAPI *pGetAudioSessionManager)(IMMDevice *device, IAudioSessionManager2 **out); + HRESULT (WINAPI *pGetAudioSessionWrapper)(const GUID *guid, IMMDevice *device, + struct audio_session_wrapper **out); HRESULT (WINAPI *pGetPropValue)(GUID *guid, const PROPERTYKEY *prop, PROPVARIANT *out); } DriverFuncs;
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/mmdevapi/Makefile.in | 1 + dlls/mmdevapi/audiosessionmanager.c | 186 ++++++++++++++++++++++++++++ dlls/mmdevapi/mmdevapi_private.h | 1 + 3 files changed, 188 insertions(+) create mode 100644 dlls/mmdevapi/audiosessionmanager.c
diff --git a/dlls/mmdevapi/Makefile.in b/dlls/mmdevapi/Makefile.in index b60372b812b..85a52d87184 100644 --- a/dlls/mmdevapi/Makefile.in +++ b/dlls/mmdevapi/Makefile.in @@ -2,6 +2,7 @@ MODULE = mmdevapi.dll IMPORTS = uuid ole32 oleaut32 user32 advapi32
C_SRCS = \ + audiosessionmanager.c \ audiovolume.c \ devenum.c \ main.c \ diff --git a/dlls/mmdevapi/audiosessionmanager.c b/dlls/mmdevapi/audiosessionmanager.c new file mode 100644 index 00000000000..039b1c264df --- /dev/null +++ b/dlls/mmdevapi/audiosessionmanager.c @@ -0,0 +1,186 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include <audiopolicy.h> +#include <mmdeviceapi.h> + +#include <wine/debug.h> +#include <wine/list.h> + +#include "mmdevapi_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi); + +static struct list g_sessions = LIST_INIT(g_sessions); + +static inline struct session_mgr *impl_from_IAudioSessionManager2(IAudioSessionManager2 *iface) +{ + return CONTAINING_RECORD(iface, struct session_mgr, IAudioSessionManager2_iface); +} + +static HRESULT WINAPI ASM_QueryInterface(IAudioSessionManager2 *iface, REFIID riid, void **ppv) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IAudioSessionManager) || + IsEqualIID(riid, &IID_IAudioSessionManager2)) + *ppv = &This->IAudioSessionManager2_iface; + else { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*ppv); + + return S_OK; +} + +static ULONG WINAPI ASM_AddRef(IAudioSessionManager2 *iface) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p) new ref %lu\n", This, ref); + return ref; +} + +static ULONG WINAPI ASM_Release(IAudioSessionManager2 *iface) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + ULONG ref = InterlockedDecrement(&This->ref); + TRACE("(%p) new ref %lu\n", This, ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +static HRESULT WINAPI ASM_GetAudioSessionControl(IAudioSessionManager2 *iface, + const GUID *guid, DWORD flags, + IAudioSessionControl **out) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + AudioSessionWrapper *wrapper; + HRESULT hr; + + TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(guid), flags, out); + + hr = drvs.pGetAudioSessionWrapper(guid, This->device, &wrapper); + if (FAILED(hr)) + return hr; + + *out = (IAudioSessionControl*)&wrapper->IAudioSessionControl2_iface; + + return S_OK; +} + +static HRESULT WINAPI ASM_GetSimpleAudioVolume(IAudioSessionManager2 *iface, + const GUID *guid, DWORD flags, + ISimpleAudioVolume **out) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + AudioSessionWrapper *wrapper; + HRESULT hr; + + TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(guid), flags, out); + + hr = drvs.pGetAudioSessionWrapper(guid, This->device, &wrapper); + if (FAILED(hr)) + return hr; + + *out = &wrapper->ISimpleAudioVolume_iface; + + return S_OK; +} + +static HRESULT WINAPI ASM_GetSessionEnumerator(IAudioSessionManager2 *iface, + IAudioSessionEnumerator **out) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%p) - stub\n", This, out); + return E_NOTIMPL; +} + +static HRESULT WINAPI ASM_RegisterSessionNotification(IAudioSessionManager2 *iface, + IAudioSessionNotification *notification) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%p) - stub\n", This, notification); + return E_NOTIMPL; +} + +static HRESULT WINAPI ASM_UnregisterSessionNotification(IAudioSessionManager2 *iface, + IAudioSessionNotification *notification) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%p) - stub\n", This, notification); + return E_NOTIMPL; +} + +static HRESULT WINAPI ASM_RegisterDuckNotification(IAudioSessionManager2 *iface, + const WCHAR *session_id, + IAudioVolumeDuckNotification *notification) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%s, %p) - stub\n", This, debugstr_w(session_id), notification); + return E_NOTIMPL; +} + +static HRESULT WINAPI ASM_UnregisterDuckNotification(IAudioSessionManager2 *iface, + IAudioVolumeDuckNotification *notification) +{ + struct session_mgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%p) - stub\n", This, notification); + return E_NOTIMPL; +} + +static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl = +{ + ASM_QueryInterface, + ASM_AddRef, + ASM_Release, + ASM_GetAudioSessionControl, + ASM_GetSimpleAudioVolume, + ASM_GetSessionEnumerator, + ASM_RegisterSessionNotification, + ASM_UnregisterSessionNotification, + ASM_RegisterDuckNotification, + ASM_UnregisterDuckNotification +}; + +HRESULT AudioSessionManager_Create(IMMDevice *device, IAudioSessionManager2 **ppv) +{ + struct session_mgr *This; + + This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This)); + if (!This) + return E_OUTOFMEMORY; + + This->IAudioSessionManager2_iface.lpVtbl = &AudioSessionManager2_Vtbl; + This->device = device; + This->ref = 1; + + *ppv = &This->IAudioSessionManager2_iface; + + return S_OK; +} diff --git a/dlls/mmdevapi/mmdevapi_private.h b/dlls/mmdevapi/mmdevapi_private.h index a61375869ee..0097786401e 100644 --- a/dlls/mmdevapi/mmdevapi_private.h +++ b/dlls/mmdevapi/mmdevapi_private.h @@ -76,6 +76,7 @@ typedef struct MMDevice {
extern HRESULT AudioClient_Create(MMDevice *parent, IAudioClient **ppv) DECLSPEC_HIDDEN; extern HRESULT AudioEndpointVolume_Create(MMDevice *parent, IAudioEndpointVolumeEx **ppv) DECLSPEC_HIDDEN; +extern HRESULT AudioSessionManager_Create(IMMDevice *device, IAudioSessionManager2 **ppv) DECLSPEC_HIDDEN; extern HRESULT SpatialAudioClient_Create(IMMDevice *device, ISpatialAudioClient **out) DECLSPEC_HIDDEN;
extern HRESULT load_devices_from_reg(void) DECLSPEC_HIDDEN;
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/mmdevapi/devenum.c | 2 +- dlls/mmdevapi/main.c | 1 - dlls/mmdevapi/mmdevapi_private.h | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c index 47456e3215c..2b7833edd08 100644 --- a/dlls/mmdevapi/devenum.c +++ b/dlls/mmdevapi/devenum.c @@ -600,7 +600,7 @@ static HRESULT WINAPI MMDevice_Activate(IMMDevice *iface, REFIID riid, DWORD cls else if (IsEqualIID(riid, &IID_IAudioSessionManager) || IsEqualIID(riid, &IID_IAudioSessionManager2)) { - hr = drvs.pGetAudioSessionManager(iface, (IAudioSessionManager2**)ppv); + hr = AudioSessionManager_Create(iface, (IAudioSessionManager2**)ppv); } else if (IsEqualIID(riid, &IID_IBaseFilter)) { diff --git a/dlls/mmdevapi/main.c b/dlls/mmdevapi/main.c index 80c5e60880c..d3d4ec6a905 100644 --- a/dlls/mmdevapi/main.c +++ b/dlls/mmdevapi/main.c @@ -100,7 +100,6 @@ static BOOL load_driver(const WCHAR *name, DriverFuncs *driver) if(!driver->p##n) { goto fail; } } while(0) LDFC(GetEndpointIDs); LDFC(GetAudioEndpoint); - LDFC(GetAudioSessionManager); LDFC(GetAudioSessionWrapper); #undef LDFC
diff --git a/dlls/mmdevapi/mmdevapi_private.h b/dlls/mmdevapi/mmdevapi_private.h index 0097786401e..684d303eefb 100644 --- a/dlls/mmdevapi/mmdevapi_private.h +++ b/dlls/mmdevapi/mmdevapi_private.h @@ -49,8 +49,6 @@ typedef struct _DriverFuncs { GUID **guids, UINT *num, UINT *default_index); HRESULT (WINAPI *pGetAudioEndpoint)(void *key, IMMDevice *dev, IAudioClient **out); - HRESULT (WINAPI *pGetAudioSessionManager)(IMMDevice *device, - IAudioSessionManager2 **out); HRESULT (WINAPI *pGetAudioSessionWrapper)(const GUID *guid, IMMDevice *device, struct audio_session_wrapper **out); HRESULT (WINAPI *pGetPropValue)(GUID *guid,
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/winealsa.drv/mmdevdrv.c | 176 ---------------------------- dlls/winealsa.drv/winealsa.drv.spec | 1 - 2 files changed, 177 deletions(-)
diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 185ae42e520..c46ae41f48b 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -78,7 +78,6 @@ static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; -static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl;
static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client);
@@ -127,11 +126,6 @@ static inline ACImpl *impl_from_IAudioStreamVolume(IAudioStreamVolume *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioStreamVolume_iface); }
-static inline SessionMgr *impl_from_IAudioSessionManager2(IAudioSessionManager2 *iface) -{ - return CONTAINING_RECORD(iface, SessionMgr, IAudioSessionManager2_iface); -} - BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) { switch (reason) @@ -2208,176 +2202,6 @@ static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl = ChannelAudioVolume_GetAllVolumes };
-static HRESULT WINAPI AudioSessionManager_QueryInterface(IAudioSessionManager2 *iface, - REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if(!ppv) - return E_POINTER; - *ppv = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAudioSessionManager) || - IsEqualIID(riid, &IID_IAudioSessionManager2)) - *ppv = iface; - if(*ppv){ - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI AudioSessionManager_AddRef(IAudioSessionManager2 *iface) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - ULONG ref; - ref = InterlockedIncrement(&This->ref); - TRACE("(%p) Refcount now %lu\n", This, ref); - return ref; -} - -static ULONG WINAPI AudioSessionManager_Release(IAudioSessionManager2 *iface) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - ULONG ref; - ref = InterlockedDecrement(&This->ref); - TRACE("(%p) Refcount now %lu\n", This, ref); - if(!ref) - HeapFree(GetProcessHeap(), 0, This); - return ref; -} - -static HRESULT WINAPI AudioSessionManager_GetAudioSessionControl( - IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, - IAudioSessionControl **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - AudioSession *session; - AudioSessionWrapper *wrapper; - HRESULT hr; - - TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), - flags, out); - - hr = get_audio_session(session_guid, This->device, 0, &session); - if(FAILED(hr)) - return hr; - - wrapper = AudioSessionWrapper_Create(NULL); - if(!wrapper) - return E_OUTOFMEMORY; - - wrapper->session = session; - - *out = (IAudioSessionControl*)&wrapper->IAudioSessionControl2_iface; - - return S_OK; -} - -static HRESULT WINAPI AudioSessionManager_GetSimpleAudioVolume( - IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, - ISimpleAudioVolume **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - AudioSession *session; - AudioSessionWrapper *wrapper; - HRESULT hr; - - TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), - flags, out); - - hr = get_audio_session(session_guid, This->device, 0, &session); - if(FAILED(hr)) - return hr; - - wrapper = AudioSessionWrapper_Create(NULL); - if(!wrapper) - return E_OUTOFMEMORY; - - wrapper->session = session; - - *out = &wrapper->ISimpleAudioVolume_iface; - - return S_OK; -} - -static HRESULT WINAPI AudioSessionManager_GetSessionEnumerator( - IAudioSessionManager2 *iface, IAudioSessionEnumerator **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, out); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_RegisterSessionNotification( - IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_UnregisterSessionNotification( - IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_RegisterDuckNotification( - IAudioSessionManager2 *iface, const WCHAR *session_id, - IAudioVolumeDuckNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_UnregisterDuckNotification( - IAudioSessionManager2 *iface, - IAudioVolumeDuckNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl = -{ - AudioSessionManager_QueryInterface, - AudioSessionManager_AddRef, - AudioSessionManager_Release, - AudioSessionManager_GetAudioSessionControl, - AudioSessionManager_GetSimpleAudioVolume, - AudioSessionManager_GetSessionEnumerator, - AudioSessionManager_RegisterSessionNotification, - AudioSessionManager_UnregisterSessionNotification, - AudioSessionManager_RegisterDuckNotification, - AudioSessionManager_UnregisterDuckNotification -}; - -HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - IAudioSessionManager2 **out) -{ - SessionMgr *This; - - This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SessionMgr)); - if(!This) - return E_OUTOFMEMORY; - - This->IAudioSessionManager2_iface.lpVtbl = &AudioSessionManager2_Vtbl; - This->device = device; - This->ref = 1; - - *out = &This->IAudioSessionManager2_iface; - - return S_OK; -} - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) { diff --git a/dlls/winealsa.drv/winealsa.drv.spec b/dlls/winealsa.drv/winealsa.drv.spec index c1f999ed0bd..d6d566e3b13 100644 --- a/dlls/winealsa.drv/winealsa.drv.spec +++ b/dlls/winealsa.drv/winealsa.drv.spec @@ -6,6 +6,5 @@ # MMDevAPI driver functions @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint -@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager @ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper @ stdcall -private GetPropValue(ptr ptr ptr) AUDDRV_GetPropValue
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/winecoreaudio.drv/mmdevdrv.c | 176 ------------------ dlls/winecoreaudio.drv/winecoreaudio.drv.spec | 1 - 2 files changed, 177 deletions(-)
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 06f74e6416a..21c2528cab1 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -60,7 +60,6 @@ static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; -static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl;
static WCHAR drv_key_devicesW[256];
@@ -121,11 +120,6 @@ static inline ACImpl *impl_from_IAudioStreamVolume(IAudioStreamVolume *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioStreamVolume_iface); }
-static inline SessionMgr *impl_from_IAudioSessionManager2(IAudioSessionManager2 *iface) -{ - return CONTAINING_RECORD(iface, SessionMgr, IAudioSessionManager2_iface); -} - BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) { switch (reason) @@ -2156,176 +2150,6 @@ static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl = ChannelAudioVolume_GetAllVolumes };
-static HRESULT WINAPI AudioSessionManager_QueryInterface(IAudioSessionManager2 *iface, - REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if(!ppv) - return E_POINTER; - *ppv = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAudioSessionManager) || - IsEqualIID(riid, &IID_IAudioSessionManager2)) - *ppv = iface; - if(*ppv){ - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI AudioSessionManager_AddRef(IAudioSessionManager2 *iface) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - ULONG ref; - ref = InterlockedIncrement(&This->ref); - TRACE("(%p) Refcount now %lu\n", This, ref); - return ref; -} - -static ULONG WINAPI AudioSessionManager_Release(IAudioSessionManager2 *iface) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - ULONG ref; - ref = InterlockedDecrement(&This->ref); - TRACE("(%p) Refcount now %lu\n", This, ref); - if(!ref) - HeapFree(GetProcessHeap(), 0, This); - return ref; -} - -static HRESULT WINAPI AudioSessionManager_GetAudioSessionControl( - IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, - IAudioSessionControl **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - AudioSession *session; - AudioSessionWrapper *wrapper; - HRESULT hr; - - TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), - flags, out); - - hr = get_audio_session(session_guid, This->device, 0, &session); - if(FAILED(hr)) - return hr; - - wrapper = AudioSessionWrapper_Create(NULL); - if(!wrapper) - return E_OUTOFMEMORY; - - wrapper->session = session; - - *out = (IAudioSessionControl*)&wrapper->IAudioSessionControl2_iface; - - return S_OK; -} - -static HRESULT WINAPI AudioSessionManager_GetSimpleAudioVolume( - IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, - ISimpleAudioVolume **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - AudioSession *session; - AudioSessionWrapper *wrapper; - HRESULT hr; - - TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), - flags, out); - - hr = get_audio_session(session_guid, This->device, 0, &session); - if(FAILED(hr)) - return hr; - - wrapper = AudioSessionWrapper_Create(NULL); - if(!wrapper) - return E_OUTOFMEMORY; - - wrapper->session = session; - - *out = &wrapper->ISimpleAudioVolume_iface; - - return S_OK; -} - -static HRESULT WINAPI AudioSessionManager_GetSessionEnumerator( - IAudioSessionManager2 *iface, IAudioSessionEnumerator **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, out); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_RegisterSessionNotification( - IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_UnregisterSessionNotification( - IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_RegisterDuckNotification( - IAudioSessionManager2 *iface, const WCHAR *session_id, - IAudioVolumeDuckNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_UnregisterDuckNotification( - IAudioSessionManager2 *iface, - IAudioVolumeDuckNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl = -{ - AudioSessionManager_QueryInterface, - AudioSessionManager_AddRef, - AudioSessionManager_Release, - AudioSessionManager_GetAudioSessionControl, - AudioSessionManager_GetSimpleAudioVolume, - AudioSessionManager_GetSessionEnumerator, - AudioSessionManager_RegisterSessionNotification, - AudioSessionManager_UnregisterSessionNotification, - AudioSessionManager_RegisterDuckNotification, - AudioSessionManager_UnregisterDuckNotification -}; - -HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - IAudioSessionManager2 **out) -{ - SessionMgr *This; - - This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SessionMgr)); - if(!This) - return E_OUTOFMEMORY; - - This->IAudioSessionManager2_iface.lpVtbl = &AudioSessionManager2_Vtbl; - This->device = device; - This->ref = 1; - - *out = &This->IAudioSessionManager2_iface; - - return S_OK; -} - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) { diff --git a/dlls/winecoreaudio.drv/winecoreaudio.drv.spec b/dlls/winecoreaudio.drv/winecoreaudio.drv.spec index 9b2200afb34..1467fc8b032 100644 --- a/dlls/winecoreaudio.drv/winecoreaudio.drv.spec +++ b/dlls/winecoreaudio.drv/winecoreaudio.drv.spec @@ -6,5 +6,4 @@ # MMDevAPI driver functions @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint -@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager @ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/wineoss.drv/mmdevdrv.c | 176 ------------------------------ dlls/wineoss.drv/wineoss.drv.spec | 1 - 2 files changed, 177 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index 70324ab805c..56e619dd163 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -86,7 +86,6 @@ static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; -static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl;
static inline ACImpl *impl_from_IAudioClient3(IAudioClient3 *iface) { @@ -133,11 +132,6 @@ static inline ACImpl *impl_from_IAudioStreamVolume(IAudioStreamVolume *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioStreamVolume_iface); }
-static inline SessionMgr *impl_from_IAudioSessionManager2(IAudioSessionManager2 *iface) -{ - return CONTAINING_RECORD(iface, SessionMgr, IAudioSessionManager2_iface); -} - BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) { switch (reason) @@ -2152,176 +2146,6 @@ static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl = ChannelAudioVolume_GetAllVolumes };
-static HRESULT WINAPI AudioSessionManager_QueryInterface(IAudioSessionManager2 *iface, - REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if(!ppv) - return E_POINTER; - *ppv = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAudioSessionManager) || - IsEqualIID(riid, &IID_IAudioSessionManager2)) - *ppv = iface; - if(*ppv){ - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI AudioSessionManager_AddRef(IAudioSessionManager2 *iface) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - ULONG ref; - ref = InterlockedIncrement(&This->ref); - TRACE("(%p) Refcount now %lu\n", This, ref); - return ref; -} - -static ULONG WINAPI AudioSessionManager_Release(IAudioSessionManager2 *iface) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - ULONG ref; - ref = InterlockedDecrement(&This->ref); - TRACE("(%p) Refcount now %lu\n", This, ref); - if(!ref) - HeapFree(GetProcessHeap(), 0, This); - return ref; -} - -static HRESULT WINAPI AudioSessionManager_GetAudioSessionControl( - IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, - IAudioSessionControl **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - AudioSession *session; - AudioSessionWrapper *wrapper; - HRESULT hr; - - TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), - flags, out); - - hr = get_audio_session(session_guid, This->device, 0, &session); - if(FAILED(hr)) - return hr; - - wrapper = AudioSessionWrapper_Create(NULL); - if(!wrapper) - return E_OUTOFMEMORY; - - wrapper->session = session; - - *out = (IAudioSessionControl*)&wrapper->IAudioSessionControl2_iface; - - return S_OK; -} - -static HRESULT WINAPI AudioSessionManager_GetSimpleAudioVolume( - IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, - ISimpleAudioVolume **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - AudioSession *session; - AudioSessionWrapper *wrapper; - HRESULT hr; - - TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), - flags, out); - - hr = get_audio_session(session_guid, This->device, 0, &session); - if(FAILED(hr)) - return hr; - - wrapper = AudioSessionWrapper_Create(NULL); - if(!wrapper) - return E_OUTOFMEMORY; - - wrapper->session = session; - - *out = &wrapper->ISimpleAudioVolume_iface; - - return S_OK; -} - -static HRESULT WINAPI AudioSessionManager_GetSessionEnumerator( - IAudioSessionManager2 *iface, IAudioSessionEnumerator **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, out); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_RegisterSessionNotification( - IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_UnregisterSessionNotification( - IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_RegisterDuckNotification( - IAudioSessionManager2 *iface, const WCHAR *session_id, - IAudioVolumeDuckNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_UnregisterDuckNotification( - IAudioSessionManager2 *iface, - IAudioVolumeDuckNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl = -{ - AudioSessionManager_QueryInterface, - AudioSessionManager_AddRef, - AudioSessionManager_Release, - AudioSessionManager_GetAudioSessionControl, - AudioSessionManager_GetSimpleAudioVolume, - AudioSessionManager_GetSessionEnumerator, - AudioSessionManager_RegisterSessionNotification, - AudioSessionManager_UnregisterSessionNotification, - AudioSessionManager_RegisterDuckNotification, - AudioSessionManager_UnregisterDuckNotification -}; - -HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - IAudioSessionManager2 **out) -{ - SessionMgr *This; - - This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SessionMgr)); - if(!This) - return E_OUTOFMEMORY; - - This->IAudioSessionManager2_iface.lpVtbl = &AudioSessionManager2_Vtbl; - This->device = device; - This->ref = 1; - - *out = &This->IAudioSessionManager2_iface; - - return S_OK; -} - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) { diff --git a/dlls/wineoss.drv/wineoss.drv.spec b/dlls/wineoss.drv/wineoss.drv.spec index a5da6bcc532..4506cc67ab5 100644 --- a/dlls/wineoss.drv/wineoss.drv.spec +++ b/dlls/wineoss.drv/wineoss.drv.spec @@ -7,5 +7,4 @@ # MMDevAPI driver functions @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint -@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager @ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper
From: Davide Beatrici git@davidebeatrici.dev
--- dlls/winepulse.drv/mmdevdrv.c | 171 -------------------------- dlls/winepulse.drv/winepulse.drv.spec | 1 - 2 files changed, 172 deletions(-)
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index b1c44fe56d5..7f1dbb765cf 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -2122,163 +2122,6 @@ static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl = AudioSessionControl_SetDuckingPreference };
-static HRESULT WINAPI AudioSessionManager_QueryInterface(IAudioSessionManager2 *iface, - REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if (!ppv) - return E_POINTER; - *ppv = NULL; - - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAudioSessionManager) || - IsEqualIID(riid, &IID_IAudioSessionManager2)) - *ppv = iface; - if (*ppv) { - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static inline SessionMgr *impl_from_IAudioSessionManager2(IAudioSessionManager2 *iface) -{ - return CONTAINING_RECORD(iface, SessionMgr, IAudioSessionManager2_iface); -} - -static ULONG WINAPI AudioSessionManager_AddRef(IAudioSessionManager2 *iface) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - ULONG ref; - ref = InterlockedIncrement(&This->ref); - TRACE("(%p) Refcount now %lu\n", This, ref); - return ref; -} - -static ULONG WINAPI AudioSessionManager_Release(IAudioSessionManager2 *iface) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - ULONG ref; - ref = InterlockedDecrement(&This->ref); - TRACE("(%p) Refcount now %lu\n", This, ref); - if (!ref) - HeapFree(GetProcessHeap(), 0, This); - return ref; -} - -static HRESULT WINAPI AudioSessionManager_GetAudioSessionControl( - IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, - IAudioSessionControl **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - AudioSession *session; - AudioSessionWrapper *wrapper; - HRESULT hr; - - TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), - flags, out); - - hr = get_audio_session(session_guid, This->device, 0, &session); - if (FAILED(hr)) - return hr; - - wrapper = AudioSessionWrapper_Create(NULL); - if (!wrapper) - return E_OUTOFMEMORY; - - wrapper->session = session; - - *out = (IAudioSessionControl*)&wrapper->IAudioSessionControl2_iface; - - return S_OK; -} - -static HRESULT WINAPI AudioSessionManager_GetSimpleAudioVolume( - IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, - ISimpleAudioVolume **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - AudioSession *session; - AudioSessionWrapper *wrapper; - HRESULT hr; - - TRACE("(%p)->(%s, %lx, %p)\n", This, debugstr_guid(session_guid), - flags, out); - - hr = get_audio_session(session_guid, This->device, 0, &session); - if (FAILED(hr)) - return hr; - - wrapper = AudioSessionWrapper_Create(NULL); - if (!wrapper) - return E_OUTOFMEMORY; - - wrapper->session = session; - - *out = &wrapper->ISimpleAudioVolume_iface; - - return S_OK; -} - -static HRESULT WINAPI AudioSessionManager_GetSessionEnumerator( - IAudioSessionManager2 *iface, IAudioSessionEnumerator **out) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, out); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_RegisterSessionNotification( - IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_UnregisterSessionNotification( - IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_RegisterDuckNotification( - IAudioSessionManager2 *iface, const WCHAR *session_id, - IAudioVolumeDuckNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static HRESULT WINAPI AudioSessionManager_UnregisterDuckNotification( - IAudioSessionManager2 *iface, - IAudioVolumeDuckNotification *notification) -{ - SessionMgr *This = impl_from_IAudioSessionManager2(iface); - FIXME("(%p)->(%p) - stub\n", This, notification); - return E_NOTIMPL; -} - -static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl = -{ - AudioSessionManager_QueryInterface, - AudioSessionManager_AddRef, - AudioSessionManager_Release, - AudioSessionManager_GetAudioSessionControl, - AudioSessionManager_GetSimpleAudioVolume, - AudioSessionManager_GetSessionEnumerator, - AudioSessionManager_RegisterSessionNotification, - AudioSessionManager_UnregisterSessionNotification, - AudioSessionManager_RegisterDuckNotification, - AudioSessionManager_UnregisterDuckNotification -}; - static HRESULT WINAPI SimpleAudioVolume_QueryInterface( ISimpleAudioVolume *iface, REFIID riid, void **ppv) { @@ -2566,20 +2409,6 @@ static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl = ChannelAudioVolume_GetAllVolumes };
-HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - IAudioSessionManager2 **out) -{ - SessionMgr *This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SessionMgr)); - *out = NULL; - if (!This) - return E_OUTOFMEMORY; - This->IAudioSessionManager2_iface.lpVtbl = &AudioSessionManager2_Vtbl; - This->device = device; - This->ref = 1; - *out = &This->IAudioSessionManager2_iface; - return S_OK; -} - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) { diff --git a/dlls/winepulse.drv/winepulse.drv.spec b/dlls/winepulse.drv/winepulse.drv.spec index 02a14aabf7a..96cbd97bd68 100644 --- a/dlls/winepulse.drv/winepulse.drv.spec +++ b/dlls/winepulse.drv/winepulse.drv.spec @@ -1,7 +1,6 @@ # MMDevAPI driver functions @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint -@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager @ stdcall -private GetAudioSessionWrapper(ptr ptr ptr) AUDDRV_GetAudioSessionWrapper @ stdcall -private GetPropValue(ptr ptr ptr) AUDDRV_GetPropValue
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=131936
Your paranoid android.
=== debian11 (build log) ===
Task: Patch failed to apply
=== debian11b (build log) ===
Task: Patch failed to apply
On Fri Apr 14 20:10:30 2023 +0000, **** wrote:
Marvin replied on the mailing list:
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=131936 Your paranoid android. === debian11 (build log) === Task: Patch failed to apply === debian11b (build log) === Task: Patch failed to apply
Mmm?
Could you squash 1ce08940e228b1f2f3aeea2dfd57cb88418cc7b7 and 26be7da54dd194b5cd428dbf0f9f09741fdfa249 together so that the first of those doesn't add a bunch of dead code?