diff --git a/reactos/dll/directx/dsound_new/classfactory.c b/reactos/dll/directx/dsound_new/classfactory.c new file mode 100644 index 00000000000..c2aeea8d2a7 --- /dev/null +++ b/reactos/dll/directx/dsound_new/classfactory.c @@ -0,0 +1,134 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Configuration of network devices + * FILE: dll/directx/dsound_new/classfactory.c + * PURPOSE: IClassFactory implementation + * + * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org) + */ + + +#include "precomp.h" + +typedef struct +{ + const IClassFactoryVtbl *lpVtbl; + LONG ref; + CLSID *rclsid; + LPFNCREATEINSTANCE lpfnCI; + const IID * riidInst; +} IClassFactoryImpl; + + +static +HRESULT +WINAPI +IClassFactory_fnQueryInterface( + LPCLASSFACTORY iface, + REFIID riid, + LPVOID *ppvObj) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + + *ppvObj = NULL; + if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) + { + *ppvObj = This; + InterlockedIncrement(&This->ref); + return S_OK; + } + return E_NOINTERFACE; +} + +static +ULONG +WINAPI +IClassFactory_fnAddRef( + LPCLASSFACTORY iface) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +static +ULONG +WINAPI +IClassFactory_fnRelease( + LPCLASSFACTORY iface) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + CoTaskMemFree(This); + return 0; + } + return refCount; +} + +static +HRESULT +WINAPI +IClassFactory_fnCreateInstance( + LPCLASSFACTORY iface, + LPUNKNOWN pUnkOuter, + REFIID riid, + LPVOID *ppvObject) +{ + IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + + *ppvObject = NULL; + + if ( This->riidInst==NULL || IsEqualCLSID(riid, This->riidInst) || IsEqualCLSID(riid, &IID_IUnknown) ) + { + return This->lpfnCI(pUnkOuter, riid, ppvObject); + } + + return E_NOINTERFACE; +} + +static +HRESULT +WINAPI IClassFactory_fnLockServer( + LPCLASSFACTORY iface, + BOOL fLock) +{ + //IClassFactoryImpl *This = (IClassFactoryImpl *)iface; + return E_NOTIMPL; +} + + +static const IClassFactoryVtbl dclfvt = +{ + IClassFactory_fnQueryInterface, + IClassFactory_fnAddRef, + IClassFactory_fnRelease, + IClassFactory_fnCreateInstance, + IClassFactory_fnLockServer +}; + + +IClassFactory * +IClassFactory_fnConstructor( + LPFNCREATEINSTANCE lpfnCI, + PLONG pcRefDll, + REFIID riidInst) +{ + IClassFactoryImpl* lpclf; + + lpclf = CoTaskMemAlloc(sizeof(IClassFactoryImpl)); + lpclf->ref = 1; + lpclf->lpVtbl = &dclfvt; + lpclf->lpfnCI = lpfnCI; + + if (pcRefDll) + InterlockedIncrement(pcRefDll); + lpclf->riidInst = riidInst; + + return (LPCLASSFACTORY)lpclf; +} + + diff --git a/reactos/dll/directx/dsound_new/dsound.c b/reactos/dll/directx/dsound_new/dsound.c new file mode 100644 index 00000000000..5b1f3417b3b --- /dev/null +++ b/reactos/dll/directx/dsound_new/dsound.c @@ -0,0 +1,52 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Configuration of network devices + * FILE: dll/directx/dsound_new/dsound.c + * PURPOSE: Handles DSound initialization + * + * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org) + */ + +#include "precomp.h" + + +HINSTANCE dsound_hInstance; + +HRESULT +WINAPI +DllCanUnloadNow() +{ + return S_FALSE; +} + +HRESULT +WINAPI +DllGetClassObject( + REFCLSID rclsid, + REFIID riid, + LPVOID *ppv) +{ + UNIMPLEMENTED + return CLASS_E_CLASSNOTAVAILABLE; +} + +BOOL +WINAPI +DllMain( + HINSTANCE hInstDLL, + DWORD fdwReason, + LPVOID lpvReserved) +{ + switch (fdwReason) + { + case DLL_PROCESS_ATTACH: + dsound_hInstance = hInstDLL; + DisableThreadLibraryCalls(dsound_hInstance); + break; + default: + break; + } + + return TRUE; +} + diff --git a/reactos/dll/directx/dsound_new/dsound.spec b/reactos/dll/directx/dsound_new/dsound.spec new file mode 100644 index 00000000000..e4878a81692 --- /dev/null +++ b/reactos/dll/directx/dsound_new/dsound.spec @@ -0,0 +1,14 @@ +1 stdcall DirectSoundCreate(ptr ptr ptr) +2 stdcall DirectSoundEnumerateA(ptr ptr) +3 stdcall DirectSoundEnumerateW(ptr ptr) +6 stdcall DirectSoundCaptureCreate(ptr ptr ptr) +7 stdcall DirectSoundCaptureEnumerateA(ptr ptr) +8 stdcall DirectSoundCaptureEnumerateW(ptr ptr) +9 stdcall GetDeviceID(ptr ptr) +10 stdcall DirectSoundFullDuplexCreate(ptr ptr ptr ptr long long ptr ptr ptr ptr) +11 stdcall DirectSoundCreate8(ptr ptr ptr) +12 stdcall DirectSoundCaptureCreate8(ptr ptr ptr) +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/reactos/dll/directx/dsound_new/dsound_new.rbuild b/reactos/dll/directx/dsound_new/dsound_new.rbuild new file mode 100644 index 00000000000..af785b00e02 --- /dev/null +++ b/reactos/dll/directx/dsound_new/dsound_new.rbuild @@ -0,0 +1,19 @@ + + + + + + . + uuid + ntdll + kernel32 + user32 + advapi32 + ole32 + winmm + dxguid + classfactory.c + dsound.c + stubs.c + version.rc + diff --git a/reactos/dll/directx/dsound_new/precomp.h b/reactos/dll/directx/dsound_new/precomp.h new file mode 100644 index 00000000000..0e5d791cd92 --- /dev/null +++ b/reactos/dll/directx/dsound_new/precomp.h @@ -0,0 +1,30 @@ +#ifndef PRECOMP_H__ +#define PRECOMP_H__ + +#define COBJMACROS +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include +#include +#include +#include +#include +#include + + +/* factory method */ +typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject); + +/* factory table */ +typedef struct +{ + REFIID riid; + LPFNCREATEINSTANCE lpfnCI; +} INTERFACE_TABLE; + +/* globals */ +extern HINSTANCE dsound_hInstance; + + +#endif diff --git a/reactos/dll/directx/dsound_new/stubs.c b/reactos/dll/directx/dsound_new/stubs.c new file mode 100644 index 00000000000..74b521ba836 --- /dev/null +++ b/reactos/dll/directx/dsound_new/stubs.c @@ -0,0 +1,137 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Configuration of network devices + * FILE: dll/directx/dsound_new/stubs.c + * PURPOSE: DSound stubs + * + * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org) + */ + +#include "precomp.h" + +HRESULT +WINAPI +DirectSoundCreate( + LPCGUID lpcGUID, + LPDIRECTSOUND *ppDS, + IUnknown *pUnkOuter) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} + + +HRESULT +WINAPI +DirectSoundEnumerateA( + LPDSENUMCALLBACKA lpDSEnumCallback, + LPVOID lpContext) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} + +HRESULT +WINAPI +DirectSoundEnumerateW( + LPDSENUMCALLBACKW lpDSEnumCallback, + LPVOID lpContext ) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} + +HRESULT +WINAPI +DllRegisterServer(void) +{ + UNIMPLEMENTED + return SELFREG_E_CLASS; +} + +HRESULT +WINAPI +DllUnregisterServer(void) +{ + UNIMPLEMENTED + return SELFREG_E_CLASS; +} + +HRESULT +WINAPI +DirectSoundCaptureCreate( + LPCGUID lpcGUID, + LPDIRECTSOUNDCAPTURE *ppDSC, + LPUNKNOWN pUnkOuter) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} + +HRESULT +WINAPI +DirectSoundCaptureCreate8( + LPCGUID lpcGUID, + LPDIRECTSOUNDCAPTURE8 *ppDSC8, + LPUNKNOWN pUnkOuter) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} + +HRESULT +WINAPI +DirectSoundCreate8( + LPCGUID lpcGUID, + LPDIRECTSOUND8 *ppDS, + IUnknown *pUnkOuter) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} + +HRESULT +WINAPI +DirectSoundFullDuplexCreate( + LPCGUID pcGuidCaptureDevice, + LPCGUID pcGuidRenderDevice, + LPCDSCBUFFERDESC pcDSCBufferDesc, + LPCDSBUFFERDESC pcDSBufferDesc, + HWND hWnd, + DWORD dwLevel, + LPDIRECTSOUNDFULLDUPLEX *ppDSFD, + LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, + LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, + LPUNKNOWN pUnkOuter) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} + +HRESULT +WINAPI +DirectSoundCaptureEnumerateA( + LPDSENUMCALLBACKA lpDSEnumCallback, + LPVOID lpContext) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} + +HRESULT +WINAPI +DirectSoundCaptureEnumerateW( + LPDSENUMCALLBACKW lpDSEnumCallback, + LPVOID lpContext) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} + +HRESULT +WINAPI +GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest) +{ + UNIMPLEMENTED + return DSERR_INVALIDPARAM; +} diff --git a/reactos/dll/directx/dsound_new/version.rc b/reactos/dll/directx/dsound_new/version.rc new file mode 100644 index 00000000000..763c823296a --- /dev/null +++ b/reactos/dll/directx/dsound_new/version.rc @@ -0,0 +1,14 @@ +#include +#include "shlobj.h" +#include "resource.h" + +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL + +#define REACTOS_VERSION_DLL +#define REACTOS_STR_FILE_DESCRIPTION "DirectSound\0" +#define REACTOS_STR_INTERNAL_NAME "dsound.dll\0" +#define REACTOS_STR_ORIGINAL_FILENAME "dsound.dll\0" +#define REACTOS_STR_PRODUCT_VERSION "5.3.1.904\0" +#define REACTOS_STR_FILE_VERSION "5.3.1.904\0" + +#include