dpvoice: Turn GetCompressionTypes into a semi-stub.

This commit is contained in:
Alex Henrie 2015-02-19 00:00:35 -07:00 committed by Alexandre Julliard
parent d3c87e5000
commit 5cd0457408
4 changed files with 45 additions and 14 deletions

View File

@ -32,6 +32,7 @@
#include "wine/debug.h" #include "wine/debug.h"
#include "dvoice.h" #include "dvoice.h"
#include "dvoice_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dpvoice); WINE_DEFAULT_DEBUG_CHANNEL(dpvoice);
@ -149,8 +150,8 @@ static HRESULT WINAPI dpvclient_GetCompressionTypes(IDirectPlayVoiceClient *ifac
DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags) DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags)
{ {
IDirectPlayVoiceClientImpl *This = impl_from_IDirectPlayVoiceClient(iface); IDirectPlayVoiceClientImpl *This = impl_from_IDirectPlayVoiceClient(iface);
FIXME("%p %p %p %p %d\n", This, pData, pdwDataSize, pdwNumElements, dwFlags); FIXME("%p %p %p %p %d semi-stub\n", This, pData, pdwDataSize, pdwNumElements, dwFlags);
return E_NOTIMPL; return DPVOICE_GetCompressionTypes(pData, pdwDataSize, pdwNumElements, dwFlags);
} }
static HRESULT WINAPI dpvclient_SetTransmitTargets(IDirectPlayVoiceClient *iface, PDVID pdvIDTargets, static HRESULT WINAPI dpvclient_SetTransmitTargets(IDirectPlayVoiceClient *iface, PDVID pdvIDTargets,

View File

@ -23,5 +23,6 @@
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; extern HRESULT DPVOICE_CreateDirectPlayVoiceServer(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPVOICE_CreateDirectPlayVoiceTest(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN; extern HRESULT DPVOICE_CreateDirectPlayVoiceTest(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppobj) DECLSPEC_HIDDEN;
extern HRESULT DPVOICE_GetCompressionTypes(DVCOMPRESSIONINFO *pData, DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags) DECLSPEC_HIDDEN;
#endif #endif

View File

@ -41,6 +41,45 @@ typedef struct IDirectPlayVoiceServerImpl
LONG ref; LONG ref;
} IDirectPlayVoiceServerImpl; } IDirectPlayVoiceServerImpl;
HRESULT DPVOICE_GetCompressionTypes(DVCOMPRESSIONINFO *pData, DWORD *pdwDataSize, DWORD *pdwNumElements, DWORD dwFlags)
{
static const DVCOMPRESSIONINFO pcm_type =
{80, {0x8de12fd4,0x7cb3,0x48ce,{0xa7,0xe8,0x9c,0x47,0xa2,0x2e,0x8a,0xc5}}, NULL, NULL, 0, 64000};
static const WCHAR pcm_name[] =
{'M','S','-','P','C','M',' ','6','4',' ','k','b','i','t','/','s',0};
HRESULT ret;
LPWSTR string_loc;
if (!pdwDataSize || !pdwNumElements)
return DVERR_INVALIDPOINTER;
if (dwFlags)
return DVERR_INVALIDFLAGS;
*pdwNumElements = 1;
if (*pdwDataSize < sizeof(pcm_type) + sizeof(pcm_name))
{
ret = DVERR_BUFFERTOOSMALL;
}
else if (!pData)
{
ret = DVERR_INVALIDPOINTER;
}
else
{
string_loc = (LPWSTR)((char*)pData + sizeof(pcm_type));
memcpy(pData, &pcm_type, sizeof(pcm_type));
memcpy(string_loc, pcm_name, sizeof(pcm_name));
pData->lpszName = string_loc;
ret = DV_OK;
}
*pdwDataSize = sizeof(pcm_type) + sizeof(pcm_name);
return ret;
}
static inline IDirectPlayVoiceServerImpl *impl_from_IDirectPlayVoiceServer(IDirectPlayVoiceServer *iface) static inline IDirectPlayVoiceServerImpl *impl_from_IDirectPlayVoiceServer(IDirectPlayVoiceServer *iface)
{ {
return CONTAINING_RECORD(iface, IDirectPlayVoiceServerImpl, IDirectPlayVoiceServer_iface); return CONTAINING_RECORD(iface, IDirectPlayVoiceServerImpl, IDirectPlayVoiceServer_iface);
@ -130,8 +169,8 @@ static HRESULT WINAPI dpvserver_GetCompressionTypes(IDirectPlayVoiceServer *ifac
DWORD *pdwNumElements, DWORD dwFlags) DWORD *pdwNumElements, DWORD dwFlags)
{ {
IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface); IDirectPlayVoiceServerImpl *This = impl_from_IDirectPlayVoiceServer(iface);
FIXME("%p %p %p %p %d\n", This, pData, pdwDataSize, pdwNumElements, dwFlags); FIXME("%p %p %p %p %d semi-stub\n", This, pData, pdwDataSize, pdwNumElements, dwFlags);
return E_NOTIMPL; return DPVOICE_GetCompressionTypes(pData, pdwDataSize, pdwNumElements, dwFlags);
} }
static HRESULT WINAPI dpvserver_SetTransmitTargets(IDirectPlayVoiceServer *iface, DVID dvSource, PDVID pdvIDTargets, static HRESULT WINAPI dpvserver_SetTransmitTargets(IDirectPlayVoiceServer *iface, DVID dvSource, PDVID pdvIDTargets,

View File

@ -420,16 +420,6 @@ static void test_GetCompressionTypes(IDirectPlayVoiceClient *client_iface, IDire
/* either client_iface or server_iface must be given, but not both */ /* either client_iface or server_iface must be given, but not both */
assert(!client_iface ^ !server_iface); assert(!client_iface ^ !server_iface);
if(client_iface)
ret = IDirectPlayVoiceClient_GetCompressionTypes(client_iface, NULL, NULL, NULL, 0);
else
ret = IDirectPlayVoiceServer_GetCompressionTypes(server_iface, NULL, NULL, NULL, 0);
if(ret == E_NOTIMPL)
{
skip("%s: GetCompressionTypes not implemented\n", name);
return;
}
if (client_iface) if (client_iface)
ret = IDirectPlayVoiceClient_GetCompressionTypes(client_iface, NULL, &data_size, &num_elements, 0); ret = IDirectPlayVoiceClient_GetCompressionTypes(client_iface, NULL, &data_size, &num_elements, 0);
else else