mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 20:22:05 +00:00
- Add an initial stub of DSound
svn path=/trunk/; revision=43774
This commit is contained in:
parent
0a1284cd40
commit
faf5c1a06b
7 changed files with 400 additions and 0 deletions
134
reactos/dll/directx/dsound_new/classfactory.c
Normal file
134
reactos/dll/directx/dsound_new/classfactory.c
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
52
reactos/dll/directx/dsound_new/dsound.c
Normal file
52
reactos/dll/directx/dsound_new/dsound.c
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
|
14
reactos/dll/directx/dsound_new/dsound.spec
Normal file
14
reactos/dll/directx/dsound_new/dsound.spec
Normal file
|
@ -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()
|
19
reactos/dll/directx/dsound_new/dsound_new.rbuild
Normal file
19
reactos/dll/directx/dsound_new/dsound_new.rbuild
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||||
|
<module name="dsound_new" type="win32dll" baseaddress="${BASEADDRESS_DSOUND}" installbase="system32" installname="dsound_new.dll" crt="msvcrt">
|
||||||
|
<autoregister infsection="OleControlDlls" type="DllRegisterServer" />
|
||||||
|
<importlibrary definition="dsound.spec" />
|
||||||
|
<include base="dsound">.</include>
|
||||||
|
<library>uuid</library>
|
||||||
|
<library>ntdll</library>
|
||||||
|
<library>kernel32</library>
|
||||||
|
<library>user32</library>
|
||||||
|
<library>advapi32</library>
|
||||||
|
<library>ole32</library>
|
||||||
|
<library>winmm</library>
|
||||||
|
<library>dxguid</library>
|
||||||
|
<file>classfactory.c</file>
|
||||||
|
<file>dsound.c</file>
|
||||||
|
<file>stubs.c</file>
|
||||||
|
<file>version.rc</file>
|
||||||
|
</module>
|
30
reactos/dll/directx/dsound_new/precomp.h
Normal file
30
reactos/dll/directx/dsound_new/precomp.h
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
#ifndef PRECOMP_H__
|
||||||
|
#define PRECOMP_H__
|
||||||
|
|
||||||
|
#define COBJMACROS
|
||||||
|
#define NONAMELESSUNION
|
||||||
|
#define NONAMELESSSTRUCT
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <setupapi.h>
|
||||||
|
#include <olectl.h>
|
||||||
|
#include <unknwn.h>
|
||||||
|
#include <dsound.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* 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
|
137
reactos/dll/directx/dsound_new/stubs.c
Normal file
137
reactos/dll/directx/dsound_new/stubs.c
Normal file
|
@ -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;
|
||||||
|
}
|
14
reactos/dll/directx/dsound_new/version.rc
Normal file
14
reactos/dll/directx/dsound_new/version.rc
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#include <windows.h>
|
||||||
|
#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 <reactos/version.rc>
|
Loading…
Add table
Add a link
Reference in a new issue