From: Andrew Eikum Subject: [PATCH 3/5] xaudio2_4: Forward to xaudio2_7 Message-Id: <20151002134947.GG13504@foghorn.codeweavers.com> Date: Fri, 2 Oct 2015 08:49:47 -0500 Signed-off-by: Andrew Eikum --- These could be squashed if you prefer. configure.ac | 1 + dlls/xaudio2_4/Makefile.in | 7 ++++++ dlls/xaudio2_4/xaudio2_4.spec | 4 +++ dlls/xaudio2_4/xaudio_classes.idl | 28 +++++++++++++++++++++ dlls/xaudio2_4/xaudio_dll.c | 52 +++++++++++++++++++++++++++++++++++++++ dlls/xaudio2_7/xaudio_dll.c | 2 ++ include/xaudio2.idl | 7 ++++++ 7 files changed, 101 insertions(+) create mode 100644 dlls/xaudio2_4/Makefile.in create mode 100644 dlls/xaudio2_4/xaudio2_4.spec create mode 100644 dlls/xaudio2_4/xaudio_classes.idl create mode 100644 dlls/xaudio2_4/xaudio_dll.c diff --git a/configure.ac b/configure.ac index ef14e14..cab34d3 100644 --- a/configure.ac +++ b/configure.ac @@ -3459,6 +3459,7 @@ WINE_CONFIG_DLL(xapofx1_3) WINE_CONFIG_DLL(xapofx1_4) WINE_CONFIG_DLL(xapofx1_5) WINE_CONFIG_DLL(xaudio2_3) +WINE_CONFIG_DLL(xaudio2_4) WINE_CONFIG_DLL(xaudio2_7,,[clean]) WINE_CONFIG_TEST(dlls/xaudio2_7/tests) WINE_CONFIG_DLL(xaudio2_8) diff --git a/dlls/xaudio2_4/Makefile.in b/dlls/xaudio2_4/Makefile.in new file mode 100644 index 0000000..9a9f19b --- /dev/null +++ b/dlls/xaudio2_4/Makefile.in @@ -0,0 +1,7 @@ +MODULE = xaudio2_4.dll +IMPORTS = ole32 + +C_SRCS = \ + xaudio_dll.c + +IDL_SRCS = xaudio_classes.idl diff --git a/dlls/xaudio2_4/xaudio2_4.spec b/dlls/xaudio2_4/xaudio2_4.spec new file mode 100644 index 0000000..cb263d4 --- /dev/null +++ b/dlls/xaudio2_4/xaudio2_4.spec @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) xaudio2_7.DllGetClassObject +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/xaudio2_4/xaudio_classes.idl b/dlls/xaudio2_4/xaudio_classes.idl new file mode 100644 index 0000000..26af295 --- /dev/null +++ b/dlls/xaudio2_4/xaudio_classes.idl @@ -0,0 +1,28 @@ +/* + * COM Classes for xaudio + * + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * 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 + */ + +#pragma makedep register + +[ + helpstring("XAudio2.4 Class"), + threading(both), + uuid(03219e78-5bc3-44d1-b92e-f63d89cc6526) +] +coclass XAudio24 { interface IXAudio27; } diff --git a/dlls/xaudio2_4/xaudio_dll.c b/dlls/xaudio2_4/xaudio_dll.c new file mode 100644 index 0000000..7c95c28 --- /dev/null +++ b/dlls/xaudio2_4/xaudio_dll.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2015 Andrew Eikum for CodeWeavers + * + * 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 + */ + +#include +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" + +static HINSTANCE instance; + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + instance = hinstance; + DisableThreadLibraryCalls(hinstance); + break; + } + return TRUE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(instance); +} diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index ed5ef49..0cea0dd 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -2462,6 +2462,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) if IsEqualGUID(rclsid, &CLSID_XAudio23){ factory = make_xaudio2_factory(23); + }else if(IsEqualGUID(rclsid, &CLSID_XAudio24)){ + factory = make_xaudio2_factory(24); }else if(IsEqualGUID(rclsid, &CLSID_XAudio2)){ factory = make_xaudio2_factory(27); }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter)) { diff --git a/include/xaudio2.idl b/include/xaudio2.idl index 1730648..ec47092 100644 --- a/include/xaudio2.idl +++ b/include/xaudio2.idl @@ -38,6 +38,13 @@ coclass XAudio23 { } [ + uuid(03219e78-5bc3-44d1-b92e-f63d89cc6526) +] +coclass XAudio24 { + interface IUnknown; +} + +[ uuid(db05ea35-0329-4d4b-a53a-6dead03d3852) ] coclass XAudio2Debug { -- 2.6.0