Commit 95763d91 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dpvoice: Add IDirectPlayVoiceServer support.

parent 300f53a4
...@@ -3,7 +3,8 @@ IMPORTS = dxguid uuid ...@@ -3,7 +3,8 @@ IMPORTS = dxguid uuid
C_SRCS = \ C_SRCS = \
client.c \ client.c \
main.c main.c \
server.c
RC_SRCS = version.rc RC_SRCS = version.rc
......
...@@ -21,5 +21,6 @@ ...@@ -21,5 +21,6 @@
#define __DVOICE_PRIVATE_H__ #define __DVOICE_PRIVATE_H__
extern HRESULT DPVOICE_CreateDirectPlayVoiceClient(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN; extern HRESULT DPVOICE_CreateDirectPlayVoiceClient(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPVOICE_CreateDirectPlayVoiceServer(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
#endif #endif
...@@ -95,6 +95,7 @@ static const IClassFactoryVtbl DICF_Vtbl = { ...@@ -95,6 +95,7 @@ static const IClassFactoryVtbl DICF_Vtbl = {
static IClassFactoryImpl DPVOICE_CFS[] = static IClassFactoryImpl DPVOICE_CFS[] =
{ {
{ { &DICF_Vtbl }, 1, &CLSID_DirectPlayVoiceClient, DPVOICE_CreateDirectPlayVoiceClient }, { { &DICF_Vtbl }, 1, &CLSID_DirectPlayVoiceClient, DPVOICE_CreateDirectPlayVoiceClient },
{ { &DICF_Vtbl }, 1, &CLSID_DirectPlayVoiceServer, DPVOICE_CreateDirectPlayVoiceServer },
{ { NULL }, 0, NULL, NULL } { { NULL }, 0, NULL, NULL }
}; };
......
/*
* DirectPlay Voice Server Interface
*
* Copyright (C) 2014 Alistair Leslie-Hughes
*
* 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 "config.h"
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "objbase.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "dvoice.h"
WINE_DEFAULT_DEBUG_CHANNEL(dpvoice);
typedef struct IDirectPlayVoiceServerImpl
{
IDirectPlayVoiceServer IDirectPlayVoiceServer_iface;
LONG ref;
} IDirectPlayVoiceServerImpl;
static inline IDirectPlayVoiceServerImpl *impl_from_IDirectPlayVoiceServer(IDirectPlayVoiceServer *iface)
{
return CONTAINING_RECORD(iface, IDirectPlayVoiceServerImpl, IDirectPlayVoiceServer_iface);
}
static HRESULT WINAPI dpvserver_QueryInterface(IDirectPlayVoiceServer *iface, REFIID riid, void **ppv)
{
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectPlayVoiceServer))
{
IUnknown_AddRef(iface);
*ppv = iface;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", iface, debugstr_guid(riid), ppv);
return E_NOINTERFACE;
}
static ULONG WINAPI dpvserver_AddRef(IDirectPlayVoiceServer *iface)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%u\n", This, ref);
return ref;
}
static ULONG WINAPI dpvserver_Release(IDirectPlayVoiceServer *iface)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) ref=%u\n", This, ref);
if (!ref)
{
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
static HRESULT WINAPI dpvserver_Initialize(IDirectPlayVoiceServer *iface, IUnknown *lpVoid, PDVMESSAGEHANDLER pMessageHandler,
void *pUserContext, DWORD *lpdwMessageMask, DWORD dwMessageMaskElements)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %p %p %p %p %d\n", This, lpVoid, pMessageHandler, pUserContext,lpdwMessageMask, dwMessageMaskElements);
return E_NOTIMPL;
}
static HRESULT WINAPI dpvserver_StartSession(IDirectPlayVoiceServer *iface, PDVSESSIONDESC pSessionDesc, DWORD dwFlags)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %p %d\n", This, pSessionDesc, dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI dpvserver_StopSession(IDirectPlayVoiceServer *iface, DWORD dwFlags)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %d\n", This, dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI dpvserver_GetSessionDesc(IDirectPlayVoiceServer *iface, PDVSESSIONDESC pvSessionDesc)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %p\n", This, pvSessionDesc);
return E_NOTIMPL;
}
static HRESULT WINAPI dpvserver_SetSessionDesc(IDirectPlayVoiceServer *iface, PDVSESSIONDESC pSessionDesc)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %p\n", This, pSessionDesc);
return E_NOTIMPL;
}
static HRESULT WINAPI dpvserver_GetCaps(IDirectPlayVoiceServer *iface, PDVCAPS pDVCaps)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %p\n", This, pDVCaps);
return E_NOTIMPL;
}
static HRESULT WINAPI dpvserver_GetCompressionTypes(IDirectPlayVoiceServer *iface, void *pData, DWORD *pdwDataSize,
DWORD *pdwNumElements, DWORD dwFlags)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %p %p %p %d\n", This, pData, pdwDataSize, pdwNumElements, dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI dpvserver_SetTransmitTargets(IDirectPlayVoiceServer *iface, DVID dvSource, PDVID pdvIDTargets,
DWORD dwNumTargets, DWORD dwFlags)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %d %p %d %d\n", This, dvSource, pdvIDTargets, dwNumTargets, dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI dpvserver_GetTransmitTargets(IDirectPlayVoiceServer *iface, DVID dvSource, PDVID pdvIDTargets,
DWORD *pdwNumTargets, DWORD dwFlags)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %d %p %p %d\n", This, dvSource, pdvIDTargets, pdwNumTargets, dwFlags);
return E_NOTIMPL;
}
static HRESULT WINAPI dpvserver_SetNotifyMask(IDirectPlayVoiceServer *iface, DWORD *pdwMessageMask, DWORD dwMessageMaskElements)
{
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %p %d\n", This, pdwMessageMask, dwMessageMaskElements);
return E_NOTIMPL;
}
static const IDirectPlayVoiceServerVtbl DirectPlayVoiceServer_Vtbl =
{
dpvserver_QueryInterface,
dpvserver_AddRef,
dpvserver_Release,
dpvserver_Initialize,
dpvserver_StartSession,
dpvserver_StopSession,
dpvserver_GetSessionDesc,
dpvserver_SetSessionDesc,
dpvserver_GetCaps,
dpvserver_GetCompressionTypes,
dpvserver_SetTransmitTargets,
dpvserver_GetTransmitTargets,
dpvserver_SetNotifyMask
};
HRESULT DPVOICE_CreateDirectPlayVoiceServer(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj)
{
IDirectPlayVoiceServerImpl* server;
HRESULT ret;
TRACE("(%p, %s, %p)\n", pUnkOuter, debugstr_guid(riid), ppobj);
*ppobj = NULL;
server = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlayVoiceServerImpl));
if (!server)
return E_OUTOFMEMORY;
server->IDirectPlayVoiceServer_iface.lpVtbl = &DirectPlayVoiceServer_Vtbl;
server->ref = 1;
ret = IDirectPlayVoiceServer_QueryInterface(&server->IDirectPlayVoiceServer_iface, riid, ppobj);
IDirectPlayVoiceServer_Release(&server->IDirectPlayVoiceServer_iface);
return ret;
}
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