Commit df167d17 authored by Rok Mandeljc's avatar Rok Mandeljc Committed by Alexandre Julliard

- implemented loader, loader's stream and loading of objects (now you

can use builtin dmloader and native other dm*.dlls) - implemented proper creation of objects and retrieval of dmusic interfaces from them (object, stream, ...) - implemented all "standard track types" and appropriate stream (for dmband, loading is almost complete) - cleaned some obsolete stuff - split debug channels
parent 1ccaaa1a
......@@ -11,6 +11,7 @@ SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = \
band.c \
bandtrack.c \
dmband_main.c \
regsvr.c
......
......@@ -19,14 +19,7 @@
#include "dmband_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/******************************************************************
* DirectMusicBand ClassFactory
*
*
*/
WINE_DEFAULT_DEBUG_CHANNEL(dmband);
typedef struct
{
......@@ -35,7 +28,11 @@ typedef struct
DWORD ref;
} IClassFactoryImpl;
static HRESULT WINAPI DMBCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
/******************************************************************
* DirectMusicBand ClassFactory
*/
static HRESULT WINAPI BandCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
......@@ -43,49 +40,109 @@ static HRESULT WINAPI DMBCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVO
return E_NOINTERFACE;
}
static ULONG WINAPI DMBCF_AddRef(LPCLASSFACTORY iface)
static ULONG WINAPI BandCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI DMBCF_Release(LPCLASSFACTORY iface)
static ULONG WINAPI BandCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI DMBCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
static HRESULT WINAPI BandCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualGUID (riid, &IID_IDirectMusicBand)) {
if (IsEqualIID (riid, &IID_IDirectMusicBand)) {
return DMUSIC_CreateDirectMusicBand (riid, (LPDIRECTMUSICBAND*) ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicBandObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI BandCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) BandCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
BandCF_QueryInterface,
BandCF_AddRef,
BandCF_Release,
BandCF_CreateInstance,
BandCF_LockServer
};
static IClassFactoryImpl Band_CF = {&BandCF_Vtbl, 1 };
/******************************************************************
* DirectMusicBandTrack ClassFactory
*/
static HRESULT WINAPI BandTrackCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI BandTrackCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI BandTrackCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI BandTrackCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicTrack)
|| IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
return DMUSIC_CreateDirectMusicBandTrack (riid, (LPDIRECTMUSICTRACK8*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI DMBCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
static HRESULT WINAPI BandTrackCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) DMBCF_Vtbl = {
static ICOM_VTABLE(IClassFactory) BandTrackCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
DMBCF_QueryInterface,
DMBCF_AddRef,
DMBCF_Release,
DMBCF_CreateInstance,
DMBCF_LockServer
BandTrackCF_QueryInterface,
BandTrackCF_AddRef,
BandTrackCF_Release,
BandTrackCF_CreateInstance,
BandTrackCF_LockServer
};
static IClassFactoryImpl DMBAND_CF = {&DMBCF_Vtbl, 1 };
static IClassFactoryImpl BandTrack_CF = {&BandTrackCF_Vtbl, 1 };
/******************************************************************
* DllMain
......@@ -129,11 +186,17 @@ HRESULT WINAPI DMBAND_DllCanUnloadNow(void)
HRESULT WINAPI DMBAND_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (&IID_IClassFactory, riid)) {
*ppv = (LPVOID) &DMBAND_CF;
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBand) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &Band_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicBandTrack) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &BandTrack_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}
......@@ -32,7 +32,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmband);
/*
* Near the bottom of this file are the exported DllRegisterServer and
......
......@@ -11,9 +11,11 @@ SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = \
chordmap.c \
chordmaptrack.c \
composer.c \
dmcompos_main.c \
regsvr.c
regsvr.c \
signposttrack.c
RC_SRCS = version.rc
......
......@@ -25,20 +25,20 @@
#include "dmcompos_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
/* IDirectMusicChordMap IUnknown parts follow: */
HRESULT WINAPI IDirectMusicChordMapImpl_QueryInterface (LPDIRECTMUSICCHORDMAP iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordMapImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicChordMap))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicChordMap)) {
IDirectMusicChordMapImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -55,8 +55,7 @@ ULONG WINAPI IDirectMusicChordMapImpl_Release (LPDIRECTMUSICCHORDMAP iface)
ICOM_THIS(IDirectMusicChordMapImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -87,8 +86,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicChordMap (LPCGUID lpcGUID, LPDIRECTMUSICC
{
IDirectMusicChordMapImpl* dmchordmap;
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicChordMap))
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicChordMap)) {
dmchordmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapImpl));
if (NULL == dmchordmap) {
*ppDMCM = (LPDIRECTMUSICCHORDMAP) NULL;
......@@ -103,3 +101,195 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicChordMap (LPCGUID lpcGUID, LPDIRECTMUSICC
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicChordMapObject implementation
*/
/* IDirectMusicChordMapObject IUnknown part: */
HRESULT WINAPI IDirectMusicChordMapObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicChordMapObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicChordMap)) {
IDirectMusicChordMap_AddRef ((LPDIRECTMUSICCHORDMAP)This->pChordMap);
*ppobj = (LPDIRECTMUSICCHORDMAP)This->pChordMap;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicChordMapObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicChordMapObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicChordMapObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicChordMapObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicChordMapObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicChordMapObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapObject_QueryInterface,
IDirectMusicChordMapObject_AddRef,
IDirectMusicChordMapObject_Release,
IDirectMusicChordMapObject_GetDescriptor,
IDirectMusicChordMapObject_SetDescriptor,
IDirectMusicChordMapObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicChordMapObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicChordMapObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicChordMapObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapObjectStream));
obj->pStream->lpVtbl = &DirectMusicChordMapObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusiChordMap */
DMUSIC_CreateDirectMusicChordMap (&IID_IDirectMusicChordMap, (LPDIRECTMUSICCHORDMAP*)&obj->pChordMap, NULL);
obj->pChordMap->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicChordMapObjectStream implementation
*/
/* IDirectMusicChordMapObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicChordMapObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicChordMapObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicChordMapObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicChordMapObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicChordMapObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicChordMapObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicChordMapObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicChordMapObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicChordMapObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicChordMapObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicChordMapObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicChordMapObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordMapObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicChordMapObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicChordMapObjectStream_QueryInterface,
IDirectMusicChordMapObjectStream_AddRef,
IDirectMusicChordMapObjectStream_Release,
IDirectMusicChordMapObjectStream_GetClassID,
IDirectMusicChordMapObjectStream_IsDirty,
IDirectMusicChordMapObjectStream_Load,
IDirectMusicChordMapObjectStream_Save,
IDirectMusicChordMapObjectStream_GetSizeMax
};
......@@ -25,16 +25,15 @@
#include "dmcompos_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
/* IDirectMusicComposer IUnknown parts follow: */
HRESULT WINAPI IDirectMusicComposerImpl_QueryInterface (LPDIRECTMUSICCOMPOSER iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicComposerImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicComposer))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicComposer)) {
IDirectMusicComposerImpl_AddRef(iface);
*ppobj = This;
return S_OK;
......@@ -55,8 +54,7 @@ ULONG WINAPI IDirectMusicComposerImpl_Release (LPDIRECTMUSICCOMPOSER iface)
ICOM_THIS(IDirectMusicComposerImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -136,8 +134,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicComposer (LPCGUID lpcGUID, LPDIRECTMUSICC
{
IDirectMusicComposerImpl* dmcompos;
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicComposer))
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicComposer)) {
dmcompos = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicComposerImpl));
if (NULL == dmcompos) {
*ppDMCP = (LPDIRECTMUSICCOMPOSER) NULL;
......
......@@ -32,7 +32,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmcompos);
/*
* Near the bottom of this file are the exported DllRegisterServer and
......
......@@ -13,14 +13,22 @@ C_SRCS = \
audiopath.c \
dmime_main.c \
graph.c \
lyricstrack.c \
markertrack.c \
paramcontroltrack.c \
patterntrack.c \
performance.c \
regsvr.c \
segment.c \
segmentstate.c \
segtriggertrack.c \
seqtrack.c \
song.c \
sysextrack.c \
tempotrack.c \
timesigtrack.c \
tool.c \
track.c
wavetrack.c
RC_SRCS = version.rc
......
......@@ -25,20 +25,20 @@
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicGraph IUnknown parts follow: */
/* IDirectMusicGraph IUnknown part: */
HRESULT WINAPI IDirectMusicGraphImpl_QueryInterface (LPDIRECTMUSICGRAPH iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicGraphImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicGraph))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicGraph)) {
IDirectMusicGraphImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
......@@ -55,14 +55,13 @@ ULONG WINAPI IDirectMusicGraphImpl_Release (LPDIRECTMUSICGRAPH iface)
ICOM_THIS(IDirectMusicGraphImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicGraph Interface follow: */
/* IDirectMusicGraph IDirectMusicGraph part: */
HRESULT WINAPI IDirectMusicGraphImpl_StampPMsg (LPDIRECTMUSICGRAPH iface, DMUS_PMSG* pPMSG)
{
ICOM_THIS(IDirectMusicGraphImpl,iface);
......@@ -160,12 +159,214 @@ ICOM_VTABLE(IDirectMusicGraph) DirectMusicGraph_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicGraph (LPCGUID lpcGUID, LPDIRECTMUSICGRAPH *ppDMGrph, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicGraph))
{
FIXME("Not yet\n");
IDirectMusicGraphImpl* dmgraph;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicGraph)) {
dmgraph = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphImpl));
if (NULL == dmgraph) {
*ppDMGrph = (LPDIRECTMUSICGRAPH) NULL;
return E_OUTOFMEMORY;
}
dmgraph->lpVtbl = &DirectMusicGraph_Vtbl;
dmgraph->ref = 1;
*ppDMGrph = (LPDIRECTMUSICGRAPH) dmgraph;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicGraphObject implementation
*/
/* IDirectMusicGraphObject IUnknown part: */
HRESULT WINAPI IDirectMusicGraphObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicGraphObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicGraph)) {
IDirectMusicGraph_AddRef ((LPDIRECTMUSICGRAPH)This->pGraph);
*ppobj = (LPDIRECTMUSICGRAPH)This->pGraph;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicGraphObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicGraphObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicGraphObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicGraphObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicGraphObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicGraphObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicGraphObject_QueryInterface,
IDirectMusicGraphObject_AddRef,
IDirectMusicGraphObject_Release,
IDirectMusicGraphObject_GetDescriptor,
IDirectMusicGraphObject_SetDescriptor,
IDirectMusicGraphObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicGraphObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicGraphObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicGraphObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicGraphObjectStream));
obj->pStream->lpVtbl = &DirectMusicGraphObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicGraph */
DMUSIC_CreateDirectMusicGraph (&IID_IDirectMusicGraph, (LPDIRECTMUSICGRAPH*)&obj->pGraph, NULL);
obj->pGraph->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicGraphObjectStream implementation
*/
/* IDirectMusicGraphObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicGraphObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicGraphObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicGraphObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicGraphObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicGraphObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicGraphObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicGraphObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicGraphObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicGraphObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicGraphObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicGraphObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicGraphObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicGraphObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicGraphObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicGraphObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicGraphObjectStream_QueryInterface,
IDirectMusicGraphObjectStream_AddRef,
IDirectMusicGraphObjectStream_Release,
IDirectMusicGraphObjectStream_GetClassID,
IDirectMusicGraphObjectStream_IsDirty,
IDirectMusicGraphObjectStream_Load,
IDirectMusicGraphObjectStream_Save,
IDirectMusicGraphObjectStream_GetSizeMax
};
......@@ -25,20 +25,20 @@
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicPatternTrack IUnknown parts follow: */
HRESULT WINAPI IDirectMusicPatternTrackImpl_QueryInterface (LPDIRECTMUSICPATTERNTRACK iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicPatternTrack))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicPatternTrack)) {
IDirectMusicPatternTrackImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -55,8 +55,7 @@ ULONG WINAPI IDirectMusicPatternTrackImpl_Release (LPDIRECTMUSICPATTERNTRACK ifa
ICOM_THIS(IDirectMusicPatternTrackImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -104,12 +103,12 @@ ICOM_VTABLE(IDirectMusicPatternTrack) DirectMusicPatternTrack_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicPatternTrack (LPCGUID lpcGUID, LPDIRECTMUSICPATTERNTRACK *ppDMPtrnTrack, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicComposer))
if (IsEqualIID (lpcGUID, &IID_IDirectMusicComposer))
{
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
WARN("No interface found\n");
return E_NOINTERFACE;
}
......@@ -25,21 +25,21 @@
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicPerformance8 IUnknown part follow: */
/* IDirectMusicPerformance8 IUnknown part: */
HRESULT WINAPI IDirectMusicPerformance8Impl_QueryInterface (LPDIRECTMUSICPERFORMANCE8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicPerformance) ||
IsEqualGUID(riid, &IID_IDirectMusicPerformance8))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicPerformance) ||
IsEqualIID (riid, &IID_IDirectMusicPerformance8)) {
IDirectMusicPerformance8Impl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -56,14 +56,13 @@ ULONG WINAPI IDirectMusicPerformance8Impl_Release (LPDIRECTMUSICPERFORMANCE8 ifa
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicPerformance8 IDirectMusicPerformance Interface part follow: */
/* IDirectMusicPerformance8 IDirectMusicPerformance Interface part: */
HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 iface, IDirectMusic** ppDirectMusic, LPDIRECTSOUND pDirectSound, HWND hWnd)
{
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
......@@ -94,7 +93,6 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_Init (LPDIRECTMUSICPERFORMANCE8 ifac
}
}
return S_OK;
}
......@@ -319,14 +317,14 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_AssignPChannelBlock (LPDIRECTMUSICPE
range = 16 * dwBlockNum;
j = 0;
for (i = range; i < range+16; i++)
{
for (i = range; i < range+16; i++) {
/*TRACE("Setting PChannel[%i] to port %p, group %ld, MIDI port %i\n", i, pPort, dwGroup-1, j); */
This->PChannel[i].port = pPort;
This->PChannel[i].group = dwGroup - 1; /* first index is always zero */
This->PChannel[i].channel = j; /* FIXME: should this be assigned? */
j++;
}
return S_OK;
}
......@@ -393,13 +391,13 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_GetGlobalParam (LPDIRECTMUSICPERFORM
TRACE("(%p, %s, %p, %ld): stub\n", This, debugstr_guid(rguidType), pParam, dwSize);
if (IsEqualGUID(rguidType, &GUID_PerfAutoDownload))
if (IsEqualGUID (rguidType, &GUID_PerfAutoDownload))
memcpy(pParam, &This->fAutoDownload, sizeof(&This->fAutoDownload));
if (IsEqualGUID(rguidType, &GUID_PerfMasterGrooveLevel))
if (IsEqualGUID (rguidType, &GUID_PerfMasterGrooveLevel))
memcpy(pParam, &This->cMasterGrooveLevel, sizeof(&This->cMasterGrooveLevel));
if (IsEqualGUID(rguidType, &GUID_PerfMasterTempo))
if (IsEqualGUID (rguidType, &GUID_PerfMasterTempo))
memcpy(pParam, &This->fMasterTempo, sizeof(&This->fMasterTempo));
if (IsEqualGUID(rguidType, &GUID_PerfMasterVolume))
if (IsEqualGUID (rguidType, &GUID_PerfMasterVolume))
memcpy(pParam, &This->lMasterVolume, sizeof(&This->lMasterVolume));
return S_OK;
......@@ -411,23 +409,19 @@ HRESULT WINAPI IDirectMusicPerformance8Impl_SetGlobalParam (LPDIRECTMUSICPERFORM
TRACE("(%p, %s, %p, %ld)\n", This, debugstr_guid(rguidType), pParam, dwSize);
if (IsEqualGUID(rguidType, &GUID_PerfAutoDownload))
{
if (IsEqualGUID (rguidType, &GUID_PerfAutoDownload)) {
memcpy(&This->fAutoDownload, pParam, dwSize);
TRACE("=> AutoDownload set to %d\n", This->fAutoDownload);
}
if (IsEqualGUID(rguidType, &GUID_PerfMasterGrooveLevel))
{
if (IsEqualGUID (rguidType, &GUID_PerfMasterGrooveLevel)) {
memcpy(&This->cMasterGrooveLevel, pParam, dwSize);
TRACE("=> MasterGrooveLevel set to %i\n", This->cMasterGrooveLevel);
}
if (IsEqualGUID(rguidType, &GUID_PerfMasterTempo))
{
if (IsEqualGUID (rguidType, &GUID_PerfMasterTempo)) {
memcpy(&This->fMasterTempo, pParam, dwSize);
TRACE("=> MasterTempo set to %f\n", This->fMasterTempo);
}
if (IsEqualGUID(rguidType, &GUID_PerfMasterVolume))
{
if (IsEqualGUID (rguidType, &GUID_PerfMasterVolume)) {
memcpy(&This->lMasterVolume, pParam, dwSize);
TRACE("=> MasterVolume set to %li\n", This->lMasterVolume);
}
......@@ -537,7 +531,7 @@ HRESULT WINAPI IDirectMusicPerformance8ImplInitAudio (LPDIRECTMUSICPERFORMANCE8
if (NULL != ppDirectSound && NULL != *ppDirectSound) {
dsound = *ppDirectSound;
} else {
DirectSoundCreate8(&IID_IDirectSound8, (LPDIRECTSOUND8*) &dsound, NULL);
DirectSoundCreate8 (&IID_IDirectSound8, (LPDIRECTSOUND8*) &dsound, NULL);
if (!dsound)
return DSERR_NODRIVER;
if (ppDirectSound)
......@@ -650,7 +644,7 @@ HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIRECTMUSI
}
/* FIXME: Should we create one secondary buffer for each PChannel? */
IDirectSound8_CreateSoundBuffer((LPDIRECTSOUND8) This->pDirectSound, &desc, &buffer, NULL);
IDirectSound8_CreateSoundBuffer ((LPDIRECTSOUND8) This->pDirectSound, &desc, &buffer, NULL);
default_path->pDSBuffer = (IDirectSoundBuffer*) buffer;
/* Update description for creating primary buffer */
......@@ -658,7 +652,7 @@ HRESULT WINAPI IDirectMusicPerformance8ImplCreateStandardAudioPath (LPDIRECTMUSI
desc.dwBufferBytes = 0;
desc.lpwfxFormat = NULL;
IDirectSound8_CreateSoundBuffer((LPDIRECTSOUND8) This->pDirectSound, &desc, &buffer, NULL);
IDirectSound8_CreateSoundBuffer ((LPDIRECTSOUND8) This->pDirectSound, &desc, &buffer, NULL);
default_path->pPrimary = (IDirectSoundBuffer*) buffer;
......@@ -674,7 +668,6 @@ HRESULT WINAPI IDirectMusicPerformance8ImplSetDefaultAudioPath (LPDIRECTMUSICPER
ICOM_THIS(IDirectMusicPerformance8Impl,iface);
FIXME("(%p, %p): semi-stub\n", This, pAudioPath);
if (NULL != This->pDefaultPath) {
IDirectMusicAudioPathImpl_Release((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath);
((IDirectMusicAudioPathImpl*) This->pDefaultPath)->pPerf = NULL;
......@@ -685,6 +678,7 @@ HRESULT WINAPI IDirectMusicPerformance8ImplSetDefaultAudioPath (LPDIRECTMUSICPER
IDirectMusicAudioPathImpl_AddRef((LPDIRECTMUSICAUDIOPATH) This->pDefaultPath);
((IDirectMusicAudioPathImpl*) This->pDefaultPath)->pPerf = (IDirectMusicPerformance8*) This;
}
return S_OK;
}
......@@ -776,8 +770,8 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicPerformance (LPCGUID lpcGUID, LPDIRECTMUS
IDirectMusicPerformance8Impl *pPerf;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDMPerf, pUnkOuter);
if (IsEqualGUID(lpcGUID, &IID_IDirectMusicPerformance) ||
IsEqualGUID(lpcGUID, &IID_IDirectMusicPerformance8)) {
if (IsEqualIID (lpcGUID, &IID_IDirectMusicPerformance) ||
IsEqualIID (lpcGUID, &IID_IDirectMusicPerformance8)) {
pPerf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicPerformance8Impl));
if (NULL == pPerf)
{
......
......@@ -32,7 +32,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/*
* Near the bottom of this file are the exported DllRegisterServer and
......
......@@ -25,18 +25,17 @@
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicSegmentState8 IUnknown part follow: */
/* IDirectMusicSegmentState8 IUnknown part: */
HRESULT WINAPI IDirectMusicSegmentState8Impl_QueryInterface (LPDIRECTMUSICSEGMENTSTATE8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicSegmentState) ||
IsEqualGUID(riid, &IID_IDirectMusicSegmentState8))
{
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IDirectMusicSegmentState) ||
IsEqualIID(riid, &IID_IDirectMusicSegmentState8)) {
IDirectMusicSegmentState8Impl_AddRef(iface);
*ppobj = This;
return S_OK;
......@@ -57,14 +56,13 @@ ULONG WINAPI IDirectMusicSegmentState8Impl_Release (LPDIRECTMUSICSEGMENTSTATE8 i
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSegmentState Interface part follow: */
/* IDirectMusicSegmentState8 IDirectMusicSegmentState part: */
HRESULT WINAPI IDirectMusicSegmentState8Impl_GetRepeats (LPDIRECTMUSICSEGMENTSTATE8 iface, DWORD* pdwRepeats)
{
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
......@@ -110,7 +108,7 @@ HRESULT WINAPI IDirectMusicSegmentState8Impl_GetStartPoint (LPDIRECTMUSICSEGMENT
return S_OK;
}
/* IDirectMusicSegmentState8 Interface part follow: */
/* IDirectMusicSegmentState8 IDirectMusicSegmentState8 part: */
HRESULT WINAPI IDirectMusicSegmentState8Impl_SetTrackConfig (LPDIRECTMUSICSEGMENTSTATE8 iface, REFGUID rguidTrackClassID, DWORD dwGroupBits, DWORD dwIndex, DWORD dwFlagsOn, DWORD dwFlagsOff)
{
ICOM_THIS(IDirectMusicSegmentState8Impl,iface);
......@@ -147,8 +145,8 @@ ICOM_VTABLE(IDirectMusicSegmentState8) DirectMusicSegmentState8_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSegmentState (LPCGUID lpcGUID, LPDIRECTMUSICSEGMENTSTATE8 *ppDMSeg, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicComposer))
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicSegmentState)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicSegmentState8)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
......
......@@ -25,20 +25,20 @@
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicSong IUnknown parts follow: */
/* IDirectMusicSong IUnknown part: */
HRESULT WINAPI IDirectMusicSongImpl_QueryInterface (LPDIRECTMUSICSONG iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicSong))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicSong)) {
IDirectMusicSongImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -55,14 +55,13 @@ ULONG WINAPI IDirectMusicSongImpl_Release (LPDIRECTMUSICSONG iface)
ICOM_THIS(IDirectMusicSongImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSong Interface follow: */
/* IDirectMusicSong IDirectMusicSong part: */
HRESULT WINAPI IDirectMusicSongImpl_Compose (LPDIRECTMUSICSONG iface)
{
ICOM_THIS(IDirectMusicSongImpl,iface);
......@@ -144,12 +143,212 @@ ICOM_VTABLE(IDirectMusicSong) DirectMusicSong_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSong (LPCGUID lpcGUID, LPDIRECTMUSICSONG *ppDMSng, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicComposer))
{
FIXME("Not yet\n");
IDirectMusicSongImpl* dmsong;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicSong)) {
dmsong = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSongImpl));
if (NULL == dmsong) {
*ppDMSng = (LPDIRECTMUSICSONG) NULL;
return E_OUTOFMEMORY;
}
dmsong->lpVtbl = &DirectMusicSong_Vtbl;
dmsong->ref = 1;
*ppDMSng = (LPDIRECTMUSICSONG) dmsong;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicSongObject implementation
*/
/* IDirectMusicSongObject IUnknown part: */
HRESULT WINAPI IDirectMusicSongObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSongObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicSongObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicSong)) {
IDirectMusicSong_AddRef ((LPDIRECTMUSICSONG)This->pSong);
*ppobj = (LPDIRECTMUSICSONG)This->pSong;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSongObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicSongObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSongObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicSongObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSongObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicSongObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicSongObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicSongObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicSongObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicSongObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicSongObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicSongObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSongObject_QueryInterface,
IDirectMusicSongObject_AddRef,
IDirectMusicSongObject_Release,
IDirectMusicSongObject_GetDescriptor,
IDirectMusicSongObject_SetDescriptor,
IDirectMusicSongObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicSongObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicSongObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSongObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicSongObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSongObjectStream));
obj->pStream->lpVtbl = &DirectMusicSongObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicSong */
DMUSIC_CreateDirectMusicSong (&IID_IDirectMusicSong, (LPDIRECTMUSICSONG*)&obj->pSong, NULL);
obj->pSong->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicSongObjectStream implementation
*/
/* IDirectMusicSongObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicSongObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSongObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicSongObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicSongObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSongObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicSongObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicSongObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSongObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicSongObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicSongObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicSongObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSongObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicSongObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSongObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicSongObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicSongObjectStream_QueryInterface,
IDirectMusicSongObjectStream_AddRef,
IDirectMusicSongObjectStream_Release,
IDirectMusicSongObjectStream_GetClassID,
IDirectMusicSongObjectStream_IsDirty,
IDirectMusicSongObjectStream_Load,
IDirectMusicSongObjectStream_Save,
IDirectMusicSongObjectStream_GetSizeMax
};
......@@ -25,18 +25,17 @@
#include "dmime_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmime);
/* IDirectMusicTool8 IUnknown part follow: */
/* IDirectMusicTool8 IUnknown part: */
HRESULT WINAPI IDirectMusicTool8Impl_QueryInterface (LPDIRECTMUSICTOOL8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicTool8Impl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicTool) ||
IsEqualGUID(riid, &IID_IDirectMusicTool8))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicTool) ||
IsEqualIID (riid, &IID_IDirectMusicTool8)) {
IDirectMusicTool8Impl_AddRef(iface);
*ppobj = This;
return S_OK;
......@@ -57,14 +56,13 @@ ULONG WINAPI IDirectMusicTool8Impl_Release (LPDIRECTMUSICTOOL8 iface)
ICOM_THIS(IDirectMusicTool8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicTool Interface follow: */
/* IDirectMusicTool8 IDirectMusicTool part: */
HRESULT WINAPI IDirectMusicTool8Impl_Init (LPDIRECTMUSICTOOL8 iface, IDirectMusicGraph* pGraph)
{
ICOM_THIS(IDirectMusicTool8Impl,iface);
......@@ -119,7 +117,7 @@ HRESULT WINAPI IDirectMusicTool8Impl_Flush (LPDIRECTMUSICTOOL8 iface, IDirectMus
return S_OK;
}
/* IDirectMusicTool8 Interface part follow: */
/* IDirectMusicTool8 IDirectMusicTool8 part: */
HRESULT WINAPI IDirectMusicTool8Impl_Clone (LPDIRECTMUSICTOOL8 iface, IDirectMusicTool** ppTool)
{
ICOM_THIS(IDirectMusicTool8Impl,iface);
......@@ -147,8 +145,7 @@ ICOM_VTABLE(IDirectMusicTool8) DirectMusicTool8_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicTool (LPCGUID lpcGUID, LPDIRECTMUSICTOOL8 *ppDMTool, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicComposer))
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicComposer)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
......
......@@ -12,8 +12,8 @@ SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = \
container.c \
dmloader_main.c \
getloader.c \
loader.c \
loaderstream.c \
regsvr.c
RC_SRCS = version.rc
......
......@@ -25,16 +25,15 @@
#include "dmloader_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
/* IDirectMusicContainer IUnknown parts follow: */
HRESULT WINAPI IDirectMusicContainerImpl_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicContainerImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicContainer))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicContainer)) {
IDirectMusicContainerImpl_AddRef(iface);
*ppobj = This;
return S_OK;
......@@ -55,8 +54,7 @@ ULONG WINAPI IDirectMusicContainerImpl_Release (LPDIRECTMUSICCONTAINER iface)
ICOM_THIS(IDirectMusicContainerImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -84,12 +82,213 @@ ICOM_VTABLE(IDirectMusicContainer) DirectMusicContainer_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicContainer (LPCGUID lpcGUID, LPDIRECTMUSICCONTAINER *ppDMCon, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicContainer))
{
FIXME("Not yet\n");
IDirectMusicContainerImpl* dmcon;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicBand)) {
dmcon = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicContainerImpl));
if (NULL == dmcon) {
*ppDMCon = (LPDIRECTMUSICCONTAINER) NULL;
return E_OUTOFMEMORY;
}
dmcon->lpVtbl = &DirectMusicContainer_Vtbl;
dmcon->ref = 1;
*ppDMCon = (LPDIRECTMUSICCONTAINER) dmcon;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicContainerObject implementation
*/
/* IDirectMusicContainerObject IUnknown part: */
HRESULT WINAPI IDirectMusicContainerObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicContainerObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicContainerObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicContainer)) {
IDirectMusicContainer_AddRef ((LPDIRECTMUSICCONTAINER)This->pContainer);
*ppobj = (LPDIRECTMUSICCONTAINER)This->pContainer;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicContainerObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicContainerObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicContainerObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicContainerObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicContainerObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicContainerObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicContainerObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicContainerObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicContainerObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicContainerObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicContainerObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicContainerObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicContainerObject_QueryInterface,
IDirectMusicContainerObject_AddRef,
IDirectMusicContainerObject_Release,
IDirectMusicContainerObject_GetDescriptor,
IDirectMusicContainerObject_SetDescriptor,
IDirectMusicContainerObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicContainerObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicContainerObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicContainerObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicContainerObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicContainerObjectStream));
obj->pStream->lpVtbl = &DirectMusicContainerObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicContainer */
DMUSIC_CreateDirectMusicContainer (&IID_IDirectMusicContainer, (LPDIRECTMUSICCONTAINER*)&obj->pContainer, NULL);
obj->pContainer->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicContainerObjectStream implementation
*/
/* IDirectMusicContainerObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicContainerObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicContainerObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicContainerObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicContainerObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicContainerObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicContainerObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicContainerObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicContainerObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicContainerObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicContainerObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicContainerObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicContainerObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicContainerObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicContainerObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicContainerObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicContainerObjectStream_QueryInterface,
IDirectMusicContainerObjectStream_AddRef,
IDirectMusicContainerObjectStream_Release,
IDirectMusicContainerObjectStream_GetClassID,
IDirectMusicContainerObjectStream_IsDirty,
IDirectMusicContainerObjectStream_Load,
IDirectMusicContainerObjectStream_Save,
IDirectMusicContainerObjectStream_GetSizeMax
};
......@@ -19,14 +19,7 @@
#include "dmloader_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/******************************************************************
* DirectMusicLoader ClassFactory
*
*
*/
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
typedef struct
{
......@@ -35,7 +28,10 @@ typedef struct
DWORD ref;
} IClassFactoryImpl;
static HRESULT WINAPI DMLOADCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
/******************************************************************
* DirectMusicLoader ClassFactory
*/
static HRESULT WINAPI LoaderCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
......@@ -43,26 +39,26 @@ static HRESULT WINAPI DMLOADCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,L
return E_NOINTERFACE;
}
static ULONG WINAPI DMLOADCF_AddRef(LPCLASSFACTORY iface)
static ULONG WINAPI LoaderCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI DMLOADCF_Release(LPCLASSFACTORY iface)
static ULONG WINAPI LoaderCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI DMLOADCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
static HRESULT WINAPI LoaderCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualGUID (&IID_IDirectMusicLoader, riid) ||
IsEqualGUID (&IID_IDirectMusicLoader8, riid)) {
if (IsEqualIID (&IID_IDirectMusicLoader, riid) ||
IsEqualIID (&IID_IDirectMusicLoader8, riid)) {
return DMUSIC_CreateDirectMusicLoader(riid, (LPDIRECTMUSICLOADER8*) ppobj, pOuter);
}
......@@ -70,23 +66,80 @@ static HRESULT WINAPI DMLOADCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pO
return E_NOINTERFACE;
}
static HRESULT WINAPI DMLOADCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
static HRESULT WINAPI LoaderCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) DMLOADCF_Vtbl = {
static ICOM_VTABLE(IClassFactory) LoaderCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
DMLOADCF_QueryInterface,
DMLOADCF_AddRef,
DMLOADCF_Release,
DMLOADCF_CreateInstance,
DMLOADCF_LockServer
LoaderCF_QueryInterface,
LoaderCF_AddRef,
LoaderCF_Release,
LoaderCF_CreateInstance,
LoaderCF_LockServer
};
static IClassFactoryImpl DMLOADER_CF = {&DMLOADCF_Vtbl, 1 };
static IClassFactoryImpl Loader_CF = {&LoaderCF_Vtbl, 1 };
/******************************************************************
* DirectMusicContainer ClassFactory
*/
static HRESULT WINAPI ContainerCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI ContainerCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI ContainerCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI ContainerCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicContainer)) {
return DMUSIC_CreateDirectMusicContainer (riid, (LPDIRECTMUSICCONTAINER*) ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicContainerObject (riid, (LPDIRECTMUSICOBJECT*) ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI ContainerCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) ContainerCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ContainerCF_QueryInterface,
ContainerCF_AddRef,
ContainerCF_Release,
ContainerCF_CreateInstance,
ContainerCF_LockServer
};
static IClassFactoryImpl Container_CF = {&ContainerCF_Vtbl, 1 };
/******************************************************************
* DllMain
......@@ -130,11 +183,16 @@ HRESULT WINAPI DMLOADER_DllCanUnloadNow(void)
HRESULT WINAPI DMLOADER_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (&IID_IClassFactory, riid)) {
*ppv = (LPVOID) &DMLOADER_CF;
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicLoader) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &Loader_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicContainer) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &Container_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}
......@@ -31,19 +31,46 @@
#include "dmusicf.h"
#include "dsound.h"
typedef struct _DMUS_PRIVATE_CACHE_ENTRY
{
GUID guidObject;
WCHAR pwzFileName[MAX_PATH];
IDirectMusicObject* pObject;
} DMUS_PRIVATE_CACHE_ENTRY, *LPDMUS_PRIVATE_CACHE_ENTRY;
typedef struct _DMUS_PRIVATE_OBJECT_REFERENCE DMUS_PRIVATE_OBJECT_REFERENCE;
struct _DMUS_PRIVATE_OBJECT_REFERENCE {
DMUS_PRIVATE_OBJECT_REFERENCE* pNext;
WCHAR pwsFileName[MAX_PATH];
GUID guidObject;
IDirectMusicObject* pObject;
};
/*****************************************************************************
* Interfaces
*/
typedef struct IDirectMusicLoader8Impl IDirectMusicLoader8Impl;
typedef struct IDirectMusicContainerImpl IDirectMusicContainerImpl;
typedef struct IDirectMusicGetLoaderImpl IDirectMusicGetLoaderImpl;
typedef struct IDirectMusicContainerObject IDirectMusicContainerObject;
typedef struct IDirectMusicContainerObjectStream IDirectMusicContainerObjectStream;
typedef struct ILoaderStream ILoaderStream;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern ICOM_VTABLE(IDirectMusicLoader8) DirectMusicLoader8_Vtbl;
extern ICOM_VTABLE(IDirectMusicContainer) DirectMusicContainer_Vtbl;
extern ICOM_VTABLE(IDirectMusicGetLoader) DirectMusicGetLoader_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicContainerObject_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicContainerObjectStream_Vtbl;
extern ICOM_VTABLE(IUnknown) LoaderStream_Unknown_Vtbl;
extern ICOM_VTABLE(IStream) LoaderStream_Stream_Vtbl;
extern ICOM_VTABLE(IDirectMusicGetLoader) LoaderStream_GetLoader_Vtbl;
/*****************************************************************************
* ClassFactory
......@@ -56,10 +83,10 @@ extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoader (LPCGUID lpcGUID, LPDIRECTM
* return always an IDirectMusicContainerImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainer (LPCGUID lpcGUID, LPDIRECTMUSICCONTAINER *ppDMCon, LPUNKNOWN pUnkOuter);
/* can support IID_IDirectMusicGetLoader
* return always an IDirectMusicGetLoaderImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicGetLoader (LPCGUID lpcGUID, LPDIRECTMUSICGETLOADER *ppDMGetLoad, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateLoaderStream (LPSTREAM *ppStream);
/*****************************************************************************
* IDirectMusicLoader8Impl implementation structure
......@@ -72,7 +99,10 @@ struct IDirectMusicLoader8Impl
/* IDirectMusicLoaderImpl fields */
WCHAR wzSearchPath[MAX_PATH];
/* IDirectMusicLoader8Impl fields */
/* simple cache */
LPDMUS_PRIVATE_CACHE_ENTRY pCache; /* cache entries */
DWORD dwCacheSize; /* nr. of entries */
};
/* IUnknown: */
......@@ -104,6 +134,7 @@ struct IDirectMusicContainerImpl
DWORD ref;
/* IDirectMusicContainerImpl fields */
IDirectMusicContainerObject* pObject;
};
/* IUnknown: */
......@@ -113,23 +144,94 @@ extern ULONG WINAPI IDirectMusicContainerImpl_Release (LPDIRECTMUSICCONTAINER
/* IDirectMusicContainer: */
extern HRESULT WINAPI IDirectMusicContainerImpl_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias);
/*****************************************************************************
* IDirectMusicGetLoaderImpl implementation structure
* IDirectMusicContainerObject implementation structure
*/
struct IDirectMusicGetLoaderImpl
struct IDirectMusicContainerObject
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicGetLoader);
ICOM_VFIELD(IDirectMusicObject);
DWORD ref;
/* IDirectMusicGetLoaderImpl fields */
/* IDirectMusicObjectImpl fields */
LPDMUS_OBJECTDESC pDesc;
IDirectMusicContainerObjectStream* pStream;
IDirectMusicContainerImpl* pContainer;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicGetLoaderImpl_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicGetLoaderImpl_AddRef (LPDIRECTMUSICGETLOADER iface);
extern ULONG WINAPI IDirectMusicGetLoaderImpl_Release (LPDIRECTMUSICGETLOADER iface);
extern HRESULT WINAPI IDirectMusicContainerObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicContainerObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicContainerObject_Release (LPDIRECTMUSICOBJECT iface);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicContainerObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicContainerObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicContainerObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/*****************************************************************************
* IDirectMusicContainerObjectStream implementation structure
*/
struct IDirectMusicContainerObjectStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicContainerObject* pParentObject;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicContainerObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicContainerObjectStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicContainerObjectStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicContainerObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicContainerObjectStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicContainerObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicContainerObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicContainerObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* ILoaderStream implementation structure
*/
struct ILoaderStream
{
/* IUnknown fields */
ICOM_VTABLE(IStream) *StreamVtbl;
ICOM_VTABLE(IDirectMusicGetLoader) *GetLoaderVtbl;
DWORD ref;
/* ILoaderStream fields */
IDirectMusicLoader8Impl* pLoader;
HANDLE hFile;
WCHAR wzFileName[MAX_PATH]; /* for clone */
};
/* Custom: */
extern HRESULT WINAPI ILoaderStream_Attach (ILoaderStream* iface, LPCWSTR wzFile, IDirectMusicLoader *pLoader);
extern void WINAPI ILoaderStream_Detach (ILoaderStream* iface);
/* IDirectMusicGetLoader: */
extern HRESULT WINAPI IDirectMusicGetLoaderImpl_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader** ppLoader);
extern HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj);
extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface);
extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface);
extern HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader);
/* IStream: */
extern HRESULT WINAPI ILoaderStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj);
extern ULONG WINAPI ILoaderStream_IStream_AddRef (LPSTREAM iface);
extern ULONG WINAPI ILoaderStream_IStream_Release (LPSTREAM iface);extern HRESULT WINAPI ILoaderStream_IStream_Read (IStream* iface, void* pv, ULONG cb, ULONG* pcbRead);
extern HRESULT WINAPI ILoaderStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten);
extern HRESULT WINAPI ILoaderStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition);
extern HRESULT WINAPI ILoaderStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize);
extern HRESULT WINAPI ILoaderStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten);
extern HRESULT WINAPI ILoaderStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags);
extern HRESULT WINAPI ILoaderStream_IStream_Revert (LPSTREAM iface);
extern HRESULT WINAPI ILoaderStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
extern HRESULT WINAPI ILoaderStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
extern HRESULT WINAPI ILoaderStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag);
extern HRESULT WINAPI ILoaderStream_IStream_Clone (LPSTREAM iface, IStream** ppstm);
#endif /* __WINE_DMLOADER_PRIVATE_H */
/* IDirectMusicGetLoader Implementation
*
* Copyright (C) 2003 Rok Mandeljc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "dmloader_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicGetLoader IUnknown parts follow: */
HRESULT WINAPI IDirectMusicGetLoaderImpl_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicGetLoaderImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicGetLoader))
{
IDirectMusicGetLoaderImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicGetLoaderImpl_AddRef (LPDIRECTMUSICGETLOADER iface)
{
ICOM_THIS(IDirectMusicGetLoaderImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicGetLoaderImpl_Release (LPDIRECTMUSICGETLOADER iface)
{
ICOM_THIS(IDirectMusicGetLoaderImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicGetLoader Interface follow: */
HRESULT WINAPI IDirectMusicGetLoaderImpl_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader** ppLoader)
{
ICOM_THIS(IDirectMusicGetLoaderImpl,iface);
FIXME("(%p, %p): stub\n", This, ppLoader);
return S_OK;
}
ICOM_VTABLE(IDirectMusicGetLoader) DirectMusicGetLoader_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicGetLoaderImpl_QueryInterface,
IDirectMusicGetLoaderImpl_AddRef,
IDirectMusicGetLoaderImpl_Release,
IDirectMusicGetLoaderImpl_GetLoader
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicGetLoader (LPCGUID lpcGUID, LPDIRECTMUSICGETLOADER *ppDMGetLoad, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicGetLoader))
{
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/* ILoaderStream Implementation
*
* Copyright (C) 2003 Rok Mandeljc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "dmloader_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
/*****************************************************************************
* Custom functions:
*/
HRESULT WINAPI ILoaderStream_Attach (ILoaderStream* This, LPCWSTR wzFile, IDirectMusicLoader *pLoader)
{
TRACE("(%p, %s, %p)\n", This, debugstr_w(wzFile), pLoader);
ILoaderStream_Detach (This);
This->hFile = CreateFileW (wzFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (This->hFile == INVALID_HANDLE_VALUE) {
TRACE(": failed\n");
return E_FAIL;
}
/* create IDirectMusicGetLoader */
(LPDIRECTMUSICLOADER)This->pLoader = pLoader;
IDirectMusicLoader8_AddRef ((LPDIRECTMUSICLOADER8)This->pLoader);
strncpyW (This->wzFileName, wzFile, MAX_PATH);
TRACE(": succeeded\n");
return S_OK;
}
void WINAPI ILoaderStream_Detach (ILoaderStream* This)
{
if (This->hFile != INVALID_HANDLE_VALUE) {
CloseHandle(This->hFile);
}
This->wzFileName[0] = (L'\0');
}
/*****************************************************************************
* ILoaderStream IStream:
*/
HRESULT WINAPI ILoaderStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj)
{
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IStream)) {
*ppobj = (LPVOID)&This->StreamVtbl;
ILoaderStream_IStream_AddRef (iface);
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicGetLoader)) {
*ppobj = (LPVOID)&This->GetLoaderVtbl;
ILoaderStream_IStream_AddRef (iface);
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI ILoaderStream_IStream_AddRef (LPSTREAM iface)
{
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI ILoaderStream_IStream_Release (LPSTREAM iface)
{
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
HRESULT WINAPI ILoaderStream_IStream_Read (LPSTREAM iface, void* pv, ULONG cb, ULONG* pcbRead)
{
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
ULONG cbRead;
if (This->hFile == INVALID_HANDLE_VALUE) return E_FAIL;
if (pcbRead == NULL) pcbRead = &cbRead;
if (!ReadFile (This->hFile, pv, cb, pcbRead, NULL) || *pcbRead != cb) return E_FAIL;
return S_OK;
}
HRESULT WINAPI ILoaderStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition)
{
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
LARGE_INTEGER liNewPos;
if (This->hFile == INVALID_HANDLE_VALUE) return E_FAIL;
liNewPos.s.HighPart = dlibMove.s.HighPart;
liNewPos.s.LowPart = SetFilePointer (This->hFile, dlibMove.s.LowPart, &liNewPos.s.HighPart, dwOrigin);
if (liNewPos.s.LowPart == 0xFFFFFFFF && GetLastError() != NO_ERROR) return E_FAIL;
if (plibNewPosition) plibNewPosition->QuadPart = liNewPos.QuadPart;
return S_OK;
}
HRESULT WINAPI ILoaderStream_IStream_Clone (LPSTREAM iface, IStream** ppstm)
{
ICOM_THIS_MULTI(ILoaderStream, StreamVtbl, iface);
ILoaderStream* pOther = NULL;
HRESULT result;
TRACE("(%p, %p)\n", iface, ppstm);
result = DMUSIC_CreateLoaderStream ((LPSTREAM*)&pOther);
if (FAILED(result)) return result;
if (This->hFile != INVALID_HANDLE_VALUE) {
ULARGE_INTEGER ullCurrentPosition;
result = ILoaderStream_Attach (pOther, This->wzFileName, (LPDIRECTMUSICLOADER)This->pLoader);
if (SUCCEEDED(result)) {
LARGE_INTEGER liZero;
liZero.QuadPart = 0;
result = ILoaderStream_IStream_Seek (iface, liZero, STREAM_SEEK_CUR, &ullCurrentPosition); /* get current position in current stream */
}
if (SUCCEEDED(result)) {
LARGE_INTEGER liNewPosition;
liNewPosition.QuadPart = ullCurrentPosition.QuadPart;
result = ILoaderStream_IStream_Seek ((LPSTREAM)pOther, liNewPosition, STREAM_SEEK_SET, &ullCurrentPosition);
}
if (FAILED(result)) {
TRACE(": failed\n");
ILoaderStream_IStream_Release ((LPSTREAM)pOther);
return result;
}
}
TRACE(": succeeded\n");
*ppstm = (IStream*)pOther;
return S_OK;
}
/* not needed*/
HRESULT WINAPI ILoaderStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten)
{
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize)
{
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten)
{
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags)
{
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_Revert (LPSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
{
return E_NOTIMPL;
}
HRESULT WINAPI ILoaderStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IStream) LoaderStream_Stream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ILoaderStream_IStream_QueryInterface,
ILoaderStream_IStream_AddRef,
ILoaderStream_IStream_Release,
ILoaderStream_IStream_Read,
ILoaderStream_IStream_Write,
ILoaderStream_IStream_Seek,
ILoaderStream_IStream_SetSize,
ILoaderStream_IStream_CopyTo,
ILoaderStream_IStream_Commit,
ILoaderStream_IStream_Revert,
ILoaderStream_IStream_LockRegion,
ILoaderStream_IStream_UnlockRegion,
ILoaderStream_IStream_Stat,
ILoaderStream_IStream_Clone
};
/*****************************************************************************
* ILoaderStream IDirectMusicGetLoader:
*/
HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj)
{
ICOM_THIS_MULTI(ILoaderStream, GetLoaderVtbl, iface);
return ILoaderStream_IStream_QueryInterface ((LPSTREAM)&This->StreamVtbl, riid, ppobj);
}
ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface)
{
ICOM_THIS_MULTI(ILoaderStream, GetLoaderVtbl, iface);
return ILoaderStream_IStream_AddRef ((LPSTREAM)&This->StreamVtbl);
}
ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface)
{
ICOM_THIS_MULTI(ILoaderStream, GetLoaderVtbl, iface);
return ILoaderStream_IStream_Release ((LPSTREAM)&This->StreamVtbl);
}
HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader)
{
ICOM_THIS_MULTI(ILoaderStream, GetLoaderVtbl, iface);
TRACE("(%p, %p)\n", This, ppLoader);
*ppLoader = (LPDIRECTMUSICLOADER)This->pLoader;
return S_OK;
}
ICOM_VTABLE(IDirectMusicGetLoader) LoaderStream_GetLoader_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
ILoaderStream_IDirectMusicGetLoader_QueryInterface,
ILoaderStream_IDirectMusicGetLoader_AddRef,
ILoaderStream_IDirectMusicGetLoader_Release,
ILoaderStream_IDirectMusicGetLoader_GetLoader
};
HRESULT WINAPI DMUSIC_CreateLoaderStream (LPSTREAM* ppStream)
{
ILoaderStream *pStream;
TRACE("(%p)\n", ppStream);
pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(ILoaderStream));
if (NULL == pStream) {
*ppStream = (LPSTREAM)NULL;
return E_OUTOFMEMORY;
}
pStream->StreamVtbl = &LoaderStream_Stream_Vtbl;
pStream->GetLoaderVtbl = &LoaderStream_GetLoader_Vtbl;
pStream->ref = 1;
*ppStream = (LPSTREAM)pStream;
return S_OK;
}
......@@ -32,7 +32,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmloader);
/*
* Near the bottom of this file are the exported DllRegisterServer and
......
......@@ -12,7 +12,8 @@ SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = \
dmscript_main.c \
regsvr.c \
script.c
script.c \
scripttrack.c
RC_SRCS = version.rc
......
......@@ -36,11 +36,23 @@
*/
typedef struct IDirectMusicScriptImpl IDirectMusicScriptImpl;
typedef struct IDirectMusicScriptObject IDirectMusicScriptObject;
typedef struct IDirectMusicScriptObjectStream IDirectMusicScriptObjectStream;
typedef struct IDirectMusicScriptTrack IDirectMusicScriptTrack;
typedef struct IDirectMusicScriptTrackStream IDirectMusicScriptTrackStream;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern ICOM_VTABLE(IDirectMusicScript) DirectMusicScript_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicScriptObject_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicScriptObjectStream_Vtbl;
extern ICOM_VTABLE(IDirectMusicTrack8) DirectMusicScriptTrack_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicScriptTrackStream_Vtbl;
/*****************************************************************************
* ClassFactory
*
......@@ -49,6 +61,10 @@ extern ICOM_VTABLE(IDirectMusicScript) DirectMusicScript_Vtbl;
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicScript (LPCGUID lpcGUID, LPDIRECTMUSICSCRIPT* ppDMScript, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptTrack (LPCGUID lpcGUID, LPDIRECTMUSICTRACK8* ppTrack, LPUNKNOWN pUnkOuter);
/*****************************************************************************
* IDirectMusicScriptImpl implementation structure
*/
......@@ -59,6 +75,7 @@ struct IDirectMusicScriptImpl
DWORD ref;
/* IDirectMusicScriptImpl fields */
IDirectMusicScriptObject* pObject;
};
/* IUnknown: */
......@@ -77,4 +94,115 @@ extern HRESULT WINAPI IDirectMusicScriptImpl_GetVariableObject (LPDIRECTMUSICSCR
extern HRESULT WINAPI IDirectMusicScriptImpl_EnumRoutine (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName);
extern HRESULT WINAPI IDirectMusicScriptImpl_EnumVariable (LPDIRECTMUSICSCRIPT iface, DWORD dwIndex, WCHAR* pwszName);
/*****************************************************************************
* IDirectMusicScriptObject implementation structure
*/
struct IDirectMusicScriptObject
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicObject);
DWORD ref;
/* IDirectMusicObjectImpl fields */
LPDMUS_OBJECTDESC pDesc;
IDirectMusicScriptObjectStream* pStream;
IDirectMusicScriptImpl* pScript;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicScriptObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicScriptObject_Release (LPDIRECTMUSICOBJECT iface);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicScriptObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicScriptObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicScriptObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/*****************************************************************************
* IDirectMusicScriptObjectStream implementation structure
*/
struct IDirectMusicScriptObjectStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicScriptObject* pParentObject;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicScriptObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicScriptObjectStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicScriptObjectStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicScriptObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicScriptObjectStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicScriptObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicScriptObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicScriptObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* IDirectMusicScriptTrack implementation structure
*/
struct IDirectMusicScriptTrack
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicTrack8);
DWORD ref;
/* IDirectMusicScriptTrack fields */
IDirectMusicScriptTrackStream* pStream;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicScriptTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicScriptTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
extern ULONG WINAPI IDirectMusicScriptTrack_Release (LPDIRECTMUSICTRACK8 iface);
/* IDirectMusicTrack: */
extern HRESULT WINAPI IDirectMusicScriptTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment);
extern HRESULT WINAPI IDirectMusicScriptTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrackID, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicScriptTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData);
extern HRESULT WINAPI IDirectMusicScriptTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicScriptTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam);
extern HRESULT WINAPI IDirectMusicScriptTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam);
extern HRESULT WINAPI IDirectMusicScriptTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType);
extern HRESULT WINAPI IDirectMusicScriptTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicScriptTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType);
extern HRESULT WINAPI IDirectMusicScriptTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack);
/* IDirectMusicTrack8: */
extern HRESULT WINAPI IDirectMusicScriptTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID);
extern HRESULT WINAPI IDirectMusicScriptTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicScriptTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags);
extern HRESULT WINAPI IDirectMusicScriptTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
extern HRESULT WINAPI IDirectMusicScriptTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack);
/*****************************************************************************
* IDirectMusicScriptTrackStream implementation structure
*/
struct IDirectMusicScriptTrackStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicScriptTrack* pParentTrack;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicScriptTrackStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicScriptTrackStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicScriptTrackStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicScriptTrackStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicScriptTrackStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicScriptTrackStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicScriptTrackStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicScriptTrackStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
#endif /* __WINE_DMSCRIPT_PRIVATE_H */
......@@ -32,7 +32,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
/*
* Near the bottom of this file are the exported DllRegisterServer and
......
......@@ -25,20 +25,20 @@
#include "dmscript_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmscript);
/* IDirectMusicScript IUnknown parts follow: */
/* IDirectMusicScript IUnknown part: */
HRESULT WINAPI IDirectMusicScriptImpl_QueryInterface (LPDIRECTMUSICSCRIPT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicScript))
{
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IDirectMusicScript)) {
IDirectMusicScriptImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -55,14 +55,13 @@ ULONG WINAPI IDirectMusicScriptImpl_Release (LPDIRECTMUSICSCRIPT iface)
ICOM_THIS(IDirectMusicScriptImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicScript Interface follow: */
/* IDirectMusicScript IDirectMusicScript part: */
HRESULT WINAPI IDirectMusicScriptImpl_Init (LPDIRECTMUSICSCRIPT iface, IDirectMusicPerformance* pPerformance, DMUS_SCRIPT_ERRORINFO* pErrorInfo)
{
ICOM_THIS(IDirectMusicScriptImpl,iface);
......@@ -174,12 +173,214 @@ ICOM_VTABLE(IDirectMusicScript) DirectMusicScript_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicScript (LPCGUID lpcGUID, LPDIRECTMUSICSCRIPT* ppDMScript, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicScript))
{
FIXME("Not yet\n");
IDirectMusicScriptImpl* dmscript;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicScript)) {
dmscript = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptImpl));
if (NULL == dmscript) {
*ppDMScript = (LPDIRECTMUSICSCRIPT) NULL;
return E_OUTOFMEMORY;
}
dmscript->lpVtbl = &DirectMusicScript_Vtbl;
dmscript->ref = 1;
*ppDMScript = (LPDIRECTMUSICSCRIPT) dmscript;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicScriptObject implementation
*/
/* IDirectMusicScriptObject IUnknown part: */
HRESULT WINAPI IDirectMusicScriptObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID(riid, &IID_IDirectMusicObject)) {
IDirectMusicScriptObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicScript)) {
IDirectMusicScript_AddRef ((LPDIRECTMUSICSCRIPT)This->pScript);
*ppobj = (LPDIRECTMUSICSCRIPT)This->pScript;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicScriptObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicScriptObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicScriptObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicScriptObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicScriptObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicScriptObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptObject_QueryInterface,
IDirectMusicScriptObject_AddRef,
IDirectMusicScriptObject_Release,
IDirectMusicScriptObject_GetDescriptor,
IDirectMusicScriptObject_SetDescriptor,
IDirectMusicScriptObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicScriptObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicScriptObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicScriptObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicScriptObjectStream));
obj->pStream->lpVtbl = &DirectMusicScriptObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicScript */
DMUSIC_CreateDirectMusicScript (&IID_IDirectMusicScript, (LPDIRECTMUSICSCRIPT*)&obj->pScript, NULL);
obj->pScript->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicScriptObjectStream implementation
*/
/* IDirectMusicScriptObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicScriptObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicScriptObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicScriptObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicScriptObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicScriptObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicScriptObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicScriptObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicScriptObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicScriptObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicScriptObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicScriptObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicScriptObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicScriptObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicScriptObjectStream_QueryInterface,
IDirectMusicScriptObjectStream_AddRef,
IDirectMusicScriptObjectStream_Release,
IDirectMusicScriptObjectStream_GetClassID,
IDirectMusicScriptObjectStream_IsDirty,
IDirectMusicScriptObjectStream_Load,
IDirectMusicScriptObjectStream_Save,
IDirectMusicScriptObjectStream_GetSizeMax
};
......@@ -10,9 +10,16 @@ LDDLLFLAGS = @LDDLLFLAGS@
SYMBOLFILE = $(MODULE).tmp.o
C_SRCS = \
auditiontrack.c \
chordtrack.c \
commandtrack.c \
dmstyle_main.c \
melodyformulationtrack.c \
motiftrack.c \
mutetrack.c \
regsvr.c \
style.c \
regsvr.c
styletrack.c
RC_SRCS = version.rc
......
......@@ -32,7 +32,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
/*
* Near the bottom of this file are the exported DllRegisterServer and
......
......@@ -25,22 +25,21 @@
#include "dmstyle_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
/* IDirectMusicStyle8 IUnknown parts follow: */
/* IDirectMusicStyle8 IUnknown part: */
HRESULT WINAPI IDirectMusicStyle8Impl_QueryInterface (LPDIRECTMUSICSTYLE8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicStyle) ||
IsEqualGUID(riid, &IID_IDirectMusicStyle8))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicStyle) ||
IsEqualIID (riid, &IID_IDirectMusicStyle8)) {
IDirectMusicStyle8Impl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -57,14 +56,13 @@ ULONG WINAPI IDirectMusicStyle8Impl_Release (LPDIRECTMUSICSTYLE8 iface)
ICOM_THIS(IDirectMusicStyle8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicStyle Interface part follow: */
/* IDirectMusicStyle8 IDirectMusicStyle part: */
HRESULT WINAPI IDirectMusicStyle8Impl_GetBand (LPDIRECTMUSICSTYLE8 iface, WCHAR* pwszName, IDirectMusicBand** ppBand)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
......@@ -164,7 +162,7 @@ HRESULT WINAPI IDirectMusicStyle8Impl_GetTempo (LPDIRECTMUSICSTYLE8 iface, doubl
return S_OK;
}
/* IDirectMusicStyle8 Interface part follow: */
/* IDirectMusicStyle8 IDirectMusicStyle8 part: */
HRESULT WINAPI IDirectMusicStyle8ImplEnumPattern (LPDIRECTMUSICSTYLE8 iface, DWORD dwIndex, DWORD dwPatternType, WCHAR* pwszName)
{
ICOM_THIS(IDirectMusicStyle8Impl,iface);
......@@ -195,15 +193,219 @@ ICOM_VTABLE(IDirectMusicStyle8) DirectMusicStyle8_Vtbl =
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicStyle (LPCGUID lpcGUID, LPDIRECTMUSICSTYLE* ppDMStyle, LPUNKNOWN pUnkOuter)
HRESULT WINAPI DMUSIC_CreateDirectMusicStyle (LPCGUID lpcGUID, LPDIRECTMUSICSTYLE8* ppDMStyle, LPUNKNOWN pUnkOuter)
{
IDirectMusicStyle8Impl* dmstlye;
if (IsEqualIID (lpcGUID, &IID_IDirectMusicStyle)
|| IsEqualIID (lpcGUID, &IID_IDirectMusicStyle8)) {
dmstlye = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyle8Impl));
if (NULL == dmstlye) {
*ppDMStyle = (LPDIRECTMUSICSTYLE8) NULL;
return E_OUTOFMEMORY;
}
dmstlye->lpVtbl = &DirectMusicStyle8_Vtbl;
dmstlye->ref = 1;
*ppDMStyle = (LPDIRECTMUSICSTYLE8) dmstlye;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicStyleObject implementation
*/
/* IDirectMusicStyleObject IUnknown part: */
HRESULT WINAPI IDirectMusicStyleObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicStyle) ||
IsEqualGUID (lpcGUID, &IID_IDirectMusicStyle8))
{
FIXME("Not yet\n");
ICOM_THIS(IDirectMusicStyleObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicStyleObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IPersistStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = (LPPERSISTSTREAM)This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicStyle)
|| IsEqualIID (riid, &IID_IDirectMusicStyle8)) {
IDirectMusicStyle8_AddRef ((LPDIRECTMUSICSTYLE8)This->pStyle);
*ppobj = (LPDIRECTMUSICSTYLE8)This->pStyle;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicStyleObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicStyleObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicStyleObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicStyleObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicStyleObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicStyleObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyleObject_QueryInterface,
IDirectMusicStyleObject_AddRef,
IDirectMusicStyleObject_Release,
IDirectMusicStyleObject_GetDescriptor,
IDirectMusicStyleObject_SetDescriptor,
IDirectMusicStyleObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicStyleObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicStyleObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyleObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicStyleObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(IDirectMusicStyleObjectStream));
obj->pStream->lpVtbl = &DirectMusicStyleObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicStyle */
DMUSIC_CreateDirectMusicStyle (&IID_IDirectMusicStyle8, (LPDIRECTMUSICSTYLE8*)&obj->pStyle, NULL);
obj->pStyle->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicStyleObjectStream implementation
*/
/* IDirectMusicStyleObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicStyleObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicStyleObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicStyleObjectStream_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicStyleObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicStyleObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicStyleObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicStyleObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicStyleObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicStyleObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicStyleObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicStyleObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyleObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FIXME(": Loading not implemented yet\n");
return S_OK;
}
HRESULT WINAPI IDirectMusicStyleObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicStyleObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicStyleObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicStyleObjectStream_QueryInterface,
IDirectMusicStyleObjectStream_AddRef,
IDirectMusicStyleObjectStream_Release,
IDirectMusicStyleObjectStream_GetClassID,
IDirectMusicStyleObjectStream_IsDirty,
IDirectMusicStyleObjectStream_Load,
IDirectMusicStyleObjectStream_Save,
IDirectMusicStyleObjectStream_GetSizeMax
};
......@@ -19,14 +19,7 @@
#include "dmsynth_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/******************************************************************
* DirectMusicSynthesizer ClassFactory
*
*
*/
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
typedef struct
{
......@@ -35,7 +28,10 @@ typedef struct
DWORD ref;
} IClassFactoryImpl;
static HRESULT WINAPI DMSYCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
/******************************************************************
* DirectMusicSynth ClassFactory
*/
static HRESULT WINAPI SynthCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
......@@ -43,51 +39,105 @@ static HRESULT WINAPI DMSYCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPV
return E_NOINTERFACE;
}
static ULONG WINAPI DMSYCF_AddRef(LPCLASSFACTORY iface)
static ULONG WINAPI SynthCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI DMSYCF_Release(LPCLASSFACTORY iface)
static ULONG WINAPI SynthCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI DMSYCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
static HRESULT WINAPI SynthCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualGUID (riid, &IID_IDirectMusicSynth) ||
IsEqualGUID (riid, &IID_IDirectMusicSynth8)) {
if (IsEqualIID (riid, &IID_IDirectMusicSynth) ||
IsEqualIID (riid, &IID_IDirectMusicSynth8)) {
return DMUSIC_CreateDirectMusicSynth (riid, (LPDIRECTMUSICSYNTH8*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicSynthSink)) {
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI SynthCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) SynthCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
SynthCF_QueryInterface,
SynthCF_AddRef,
SynthCF_Release,
SynthCF_CreateInstance,
SynthCF_LockServer
};
static IClassFactoryImpl Synth_CF = {&SynthCF_Vtbl, 1 };
/******************************************************************
* DirectMusicSynthSink ClassFactory
*/
static HRESULT WINAPI SynthSinkCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI SynthSinkCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI SynthSinkCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI SynthSinkCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicSynthSink)) {
return DMUSIC_CreateDirectMusicSynthSink (riid, (LPDIRECTMUSICSYNTHSINK*)ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI DMSYCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
static HRESULT WINAPI SynthSinkCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) DMSYCF_Vtbl = {
static ICOM_VTABLE(IClassFactory) SynthSinkCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
DMSYCF_QueryInterface,
DMSYCF_AddRef,
DMSYCF_Release,
DMSYCF_CreateInstance,
DMSYCF_LockServer
SynthSinkCF_QueryInterface,
SynthSinkCF_AddRef,
SynthSinkCF_Release,
SynthSinkCF_CreateInstance,
SynthSinkCF_LockServer
};
static IClassFactoryImpl DMSYNTH_CF = {&DMSYCF_Vtbl, 1 };
static IClassFactoryImpl SynthSink_CF = {&SynthSinkCF_Vtbl, 1 };
/******************************************************************
* DllMain
......@@ -131,11 +181,16 @@ HRESULT WINAPI DMSYNTH_DllCanUnloadNow(void)
HRESULT WINAPI DMSYNTH_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (&IID_IClassFactory, riid)) {
*ppv = (LPVOID) &DMSYNTH_CF;
if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSynth) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &Synth_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicSynth) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &SynthSink_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}
......@@ -32,7 +32,7 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
/*
* Near the bottom of this file are the exported DllRegisterServer and
......
......@@ -26,21 +26,21 @@
#include "dmsynth_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
/* IDirectMusicSynth8 IUnknown parts follow: */
/* IDirectMusicSynth8 IUnknown part: */
HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface (LPDIRECTMUSICSYNTH8 iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSynth8Impl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicSynth) ||
IsEqualGUID(riid, &IID_IDirectMusicSynth8))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicSynth) ||
IsEqualIID (riid, &IID_IDirectMusicSynth8)) {
IDirectMusicSynth8Impl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -57,14 +57,13 @@ ULONG WINAPI IDirectMusicSynth8Impl_Release (LPDIRECTMUSICSYNTH8 iface)
ICOM_THIS(IDirectMusicSynth8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSynth Interface parts follow: */
/* IDirectMusicSynth8 IDirectMusicSynth part: */
HRESULT WINAPI IDirectMusicSynth8Impl_Open (LPDIRECTMUSICSYNTH8 iface, LPDMUS_PORTPARAMS pPortParams)
{
ICOM_THIS(IDirectMusicSynth8Impl,iface);
......@@ -223,7 +222,7 @@ HRESULT WINAPI IDirectMusicSynth8Impl_GetAppend (LPDIRECTMUSICSYNTH8 iface, DWOR
return S_OK;
}
/* IDirectMusicSynth8 Interface parts follow: */
/* IDirectMusicSynth8 IDirectMusicSynth8 part: */
HRESULT WINAPI IDirectMusicSynth8Impl_PlayVoice (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, DWORD dwVoiceId, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwDLId, long prPitch, long vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, SAMPLE_TIME stLoopEnd)
{
ICOM_THIS(IDirectMusicSynth8Impl,iface);
......@@ -305,8 +304,8 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSynth (LPCGUID lpcGUID, LPDIRECTMUSICSYNT
IDirectMusicSynth8Impl *dmsynth;
TRACE("(%p,%p,%p)\n", lpcGUID, ppDMSynth, pUnkOuter);
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicSynth) ||
IsEqualGUID (lpcGUID, &IID_IDirectMusicSynth8)) {
if (IsEqualIID (lpcGUID, &IID_IDirectMusicSynth) ||
IsEqualIID (lpcGUID, &IID_IDirectMusicSynth8)) {
dmsynth = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynth8Impl));
if (NULL == dmsynth) {
*ppDMSynth = (LPDIRECTMUSICSYNTH8) NULL;
......
......@@ -25,20 +25,20 @@
#include "dmsynth_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
/* IDirectMusicSynthSink IUnknown parts follow: */
/* IDirectMusicSynthSink IUnknown part: */
HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusicSynthSink))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusicSynthSink)) {
IDirectMusicSynthSinkImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -55,14 +55,13 @@ ULONG WINAPI IDirectMusicSynthSinkImpl_Release (LPDIRECTMUSICSYNTHSINK iface)
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicSynth Interface follow: */
/* IDirectMusicSynth IDirectMusicSynth part: */
HRESULT WINAPI IDirectMusicSynthSinkImpl_Init (LPDIRECTMUSICSYNTHSINK iface, IDirectMusicSynth* pSynth)
{
ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
......@@ -157,7 +156,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSink (LPCGUID lpcGUID, LPDIRECTMUSIC
IDirectMusicSynthSinkImpl *dmsink;
TRACE("(%p,%p,%p)\n", lpcGUID, ppDMSynthSink, pUnkOuter);
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicSynthSink)) {
if (IsEqualIID (lpcGUID, &IID_IDirectMusicSynthSink)) {
dmsink = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynthSinkImpl));
if (NULL == dmsink) {
*ppDMSynthSink = (LPDIRECTMUSICSYNTHSINK) NULL;
......@@ -168,7 +167,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSink (LPCGUID lpcGUID, LPDIRECTMUSIC
*ppDMSynthSink = (LPDIRECTMUSICSYNTHSINK) dmsink;
return S_OK;
}
WARN("No interface found\n");
WARN("No interface found\n");
return E_NOINTERFACE;
}
......@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = dmusic.dll
IMPORTS = winmm ole32 msacm32 dsound rpcrt4 user32 advapi32 kernel32
IMPORTS = winmm ole32 msacm32 dsound rpcrt4 user32 advapi32 kernel32 ntdll
EXTRALIBS = $(LIBUUID)
LDDLLFLAGS = @LDDLLFLAGS@
......@@ -17,9 +17,7 @@ C_SRCS = \
dmusic_main.c \
download.c \
downloadedinstrument.c \
helper.c \
instrument.c \
object.c \
port.c \
portdownload.c \
regsvr.c \
......
......@@ -43,12 +43,13 @@ HRESULT WINAPI IDirectMusicBufferImpl_QueryInterface (LPDIRECTMUSICBUFFER iface,
{
ICOM_THIS(IDirectMusicBufferImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicBuffer))
{
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicBuffer)) {
IDirectMusicBufferImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
......@@ -65,8 +66,7 @@ ULONG WINAPI IDirectMusicBufferImpl_Release (LPDIRECTMUSICBUFFER iface)
ICOM_THIS(IDirectMusicBufferImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -214,12 +214,11 @@ ICOM_VTABLE(IDirectMusicBuffer) DirectMusicBuffer_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicBuffer (LPCGUID lpcGUID, LPDIRECTMUSICBUFFER* ppDMBuff, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicBuffer))
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicBuffer)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
WARN("No interface found\n");
return E_NOINTERFACE;
}
......@@ -32,13 +32,13 @@ HRESULT WINAPI IReferenceClockImpl_QueryInterface (IReferenceClock *iface, REFII
{
ICOM_THIS(IReferenceClockImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IReferenceClock))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IReferenceClock)) {
IReferenceClockImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
......@@ -55,8 +55,7 @@ ULONG WINAPI IReferenceClockImpl_Release (IReferenceClock *iface)
ICOM_THIS(IReferenceClockImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -117,7 +116,7 @@ HRESULT WINAPI DMUSIC_CreateReferenceClock (LPCGUID lpcGUID, IReferenceClock** p
{
IReferenceClockImpl* clock;
if (IsEqualGUID (lpcGUID, &IID_IReferenceClock))
if (IsEqualIID (lpcGUID, &IID_IReferenceClock))
{
clock = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IReferenceClockImpl));
if (NULL == clock) {
......@@ -132,7 +131,7 @@ HRESULT WINAPI DMUSIC_CreateReferenceClock (LPCGUID lpcGUID, IReferenceClock** p
*ppRC = (IReferenceClock *) clock;
return S_OK;
}
WARN("No interface found\n");
WARN("No interface found\n");
return E_NOINTERFACE;
}
......@@ -32,12 +32,13 @@ HRESULT WINAPI IDirectMusicCollectionImpl_QueryInterface (LPDIRECTMUSICCOLLECTIO
{
ICOM_THIS(IDirectMusicCollectionImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicCollection))
{
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicCollection)) {
IDirectMusicCollectionImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
......@@ -54,8 +55,7 @@ ULONG WINAPI IDirectMusicCollectionImpl_Release (LPDIRECTMUSICCOLLECTION iface)
ICOM_THIS(IDirectMusicCollectionImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -65,17 +65,33 @@ ULONG WINAPI IDirectMusicCollectionImpl_Release (LPDIRECTMUSICCOLLECTION iface)
HRESULT WINAPI IDirectMusicCollectionImpl_GetInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwPatch, IDirectMusicInstrument** ppInstrument)
{
ICOM_THIS(IDirectMusicCollectionImpl,iface);
int i;
FIXME("(%p, %ld, %p): stub\n", This, dwPatch, ppInstrument);
TRACE("(%p, %ld, %p)\n", This, dwPatch, ppInstrument);
for (i = 0; i < This->nrofinstruments; i++) {
if (This->ppInstruments[i]->dwPatch == dwPatch) {
*ppInstrument = (LPDIRECTMUSICINSTRUMENT)This->ppInstruments[i];
return S_OK;
}
}
return DMUS_E_INVALIDPATCH;
}
HRESULT WINAPI IDirectMusicCollectionImpl_EnumInstrument (LPDIRECTMUSICCOLLECTION iface, DWORD dwIndex, DWORD* pdwPatch, LPWSTR pwszName, DWORD dwNameLen)
{
ICOM_THIS(IDirectMusicCollectionImpl,iface);
FIXME("(%p, %ld, %p, %p, %ld): stub\n", This, dwIndex, pdwPatch, pwszName, dwNameLen);
TRACE("(%p, %ld, %p, %p, %ld)\n", This, dwIndex, pdwPatch, pwszName, dwNameLen);
if (dwIndex > This->nrofinstruments)
return S_FALSE;
*pdwPatch = This->ppInstruments[dwIndex]->dwPatch;
if (pwszName != NULL) {
/*
*pwszName = (LPWSTR)This->ppInstruments[dwIndex]->pwszName;
*dwNameLen = wcslen (This->ppInstruments[dwIndex]->pwszName);
*/
}
return S_OK;
}
......@@ -93,12 +109,228 @@ ICOM_VTABLE(IDirectMusicCollection) DirectMusicCollection_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicCollection (LPCGUID lpcGUID, LPDIRECTMUSICCOLLECTION* ppDMColl, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicCollection))
{
FIXME("Not yet\n");
IDirectMusicCollectionImpl *collection;
TRACE("(%p,%p,%p)\n", lpcGUID, ppDMColl, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicCollection)) {
collection = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCollectionImpl));
if (NULL == collection) {
*ppDMColl = (LPDIRECTMUSICCOLLECTION) NULL;
return E_OUTOFMEMORY;
}
collection->lpVtbl = &DirectMusicCollection_Vtbl;
collection->ref = 1;
*ppDMColl = (LPDIRECTMUSICCOLLECTION) collection;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicCollectionObject implementation
*/
/* IDirectMusicCollectionObject IUnknown part: */
HRESULT WINAPI IDirectMusicCollectionObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicCollectionObject,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicObject)) {
IDirectMusicCollectionObject_AddRef(iface);
*ppobj = This;
return S_OK;
} else if (IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicCollectionObjectStream_AddRef ((LPPERSISTSTREAM)This->pStream);
*ppobj = This->pStream;
return S_OK;
} else if (IsEqualIID (riid, &IID_IDirectMusicCollection)) {
IDirectMusicCollectionImpl_AddRef ((LPDIRECTMUSICCOLLECTION)This->pCollection);
*ppobj = This->pCollection;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicCollectionObject_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicCollectionObject,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicCollectionObject_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicCollectionObject,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicCollectionObject IDirectMusicObject part: */
HRESULT WINAPI IDirectMusicCollectionObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicCollectionObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicCollectionObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicCollectionObject,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicCollectionObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicCollectionObject,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicCollectionObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicCollectionObject_QueryInterface,
IDirectMusicCollectionObject_AddRef,
IDirectMusicCollectionObject_Release,
IDirectMusicCollectionObject_GetDescriptor,
IDirectMusicCollectionObject_SetDescriptor,
IDirectMusicCollectionObject_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter)
{
IDirectMusicCollectionObject *obj;
TRACE("(%p,%p,%p)\n", lpcGUID, ppObject, pUnkOuter);
if (IsEqualIID (lpcGUID, &IID_IDirectMusicObject)) {
obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCollectionObject));
if (NULL == obj) {
*ppObject = (LPDIRECTMUSICOBJECT) NULL;
return E_OUTOFMEMORY;
}
obj->lpVtbl = &DirectMusicCollectionObject_Vtbl;
obj->ref = 1;
/* prepare IPersistStream */
obj->pStream = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCollectionObjectStream));
obj->pStream->lpVtbl = &DirectMusicCollectionObjectStream_Vtbl;
obj->pStream->ref = 1;
obj->pStream->pParentObject = obj;
/* prepare IDirectMusicCollection */
DMUSIC_CreateDirectMusicCollection (&IID_IDirectMusicCollection, (LPDIRECTMUSICCOLLECTION*)&obj->pCollection, NULL);
obj->pCollection->pObject = obj;
*ppObject = (LPDIRECTMUSICOBJECT) obj;
return S_OK;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
/*****************************************************************************
* IDirectMusicCollectionObjectStream implementation
*/
/* IDirectMusicCollectionObjectStream IUnknown part: */
HRESULT WINAPI IDirectMusicCollectionObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicCollectionObjectStream,iface);
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IPersistStream)) {
IDirectMusicCollectionObjectStream_AddRef (iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicCollectionObjectStream_AddRef (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicCollectionObjectStream,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicCollectionObjectStream_Release (LPPERSISTSTREAM iface)
{
ICOM_THIS(IDirectMusicCollectionObjectStream,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicCollectionObjectStream IPersist part: */
HRESULT WINAPI IDirectMusicCollectionObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID)
{
return E_NOTIMPL;
}
/* IDirectMusicCollectionObjectStream IPersistStream part: */
HRESULT WINAPI IDirectMusicCollectionObjectStream_IsDirty (LPPERSISTSTREAM iface)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicCollectionObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm)
{
FOURCC chunkID;
DWORD chunkSize;
IStream_Read (pStm, &chunkID, sizeof(FOURCC), NULL);
IStream_Read (pStm, &chunkSize, sizeof(FOURCC), NULL);
if (chunkID == FOURCC_RIFF) {
FIXME(": Loading not implemented yet\n");
} else {
WARN("Not a RIFF file\n");
return E_FAIL;
}
return S_OK;
}
HRESULT WINAPI IDirectMusicCollectionObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty)
{
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicCollectionObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize)
{
return E_NOTIMPL;
}
ICOM_VTABLE(IPersistStream) DirectMusicCollectionObjectStream_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicCollectionObjectStream_QueryInterface,
IDirectMusicCollectionObjectStream_AddRef,
IDirectMusicCollectionObjectStream_Release,
IDirectMusicCollectionObjectStream_GetClassID,
IDirectMusicCollectionObjectStream_IsDirty,
IDirectMusicCollectionObjectStream_Load,
IDirectMusicCollectionObjectStream_Save,
IDirectMusicCollectionObjectStream_GetSizeMax
};
......@@ -22,7 +22,6 @@
#include "winreg.h"
#include "winuser.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "mmsystem.h"
#include "winternl.h"
......@@ -41,14 +40,14 @@ HRESULT WINAPI IDirectMusic8Impl_QueryInterface (LPDIRECTMUSIC8 iface, REFIID ri
{
ICOM_THIS(IDirectMusic8Impl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IDirectMusic2) ||
IsEqualGUID(riid, &IID_IDirectMusic8))
{
if (IsEqualIID (riid, &IID_IUnknown) ||
IsEqualIID (riid, &IID_IDirectMusic2) ||
IsEqualIID (riid, &IID_IDirectMusic8)) {
IDirectMusic8Impl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
......@@ -65,8 +64,7 @@ ULONG WINAPI IDirectMusic8Impl_Release (LPDIRECTMUSIC8 iface)
ICOM_THIS(IDirectMusic8Impl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -132,7 +130,7 @@ HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLSID rcls
TRACE("(%p, %s, %p, %p, %p)\n", This, debugstr_guid(rclsidPort), pPortParams, ppPort, pUnkOuter);
for (i = 0; S_FALSE != IDirectMusic8Impl_EnumPort(iface, i, &PortCaps); i++) {
if (IsEqualGUID(rclsidPort, &PortCaps.guidPort)) {
if (IsEqualCLSID (rclsidPort, &PortCaps.guidPort)) {
This->ppPorts = HeapReAlloc(GetProcessHeap(), 0, This->ppPorts, sizeof(LPDIRECTMUSICPORT) * This->nrofports);
if (NULL == This->ppPorts[This->nrofports]) {
*ppPort = (LPDIRECTMUSICPORT)NULL;
......@@ -310,9 +308,9 @@ HRESULT WINAPI DMUSIC_CreateDirectMusic (LPCGUID lpcGUID, LPDIRECTMUSIC8 *ppDM,
IDirectMusic8Impl *dmusic;
TRACE("(%p,%p,%p)\n",lpcGUID, ppDM, pUnkOuter);
if (IsEqualGUID(lpcGUID, &IID_IDirectMusic) ||
IsEqualGUID(lpcGUID, &IID_IDirectMusic2) ||
IsEqualGUID(lpcGUID, &IID_IDirectMusic8)) {
if (IsEqualIID (lpcGUID, &IID_IDirectMusic) ||
IsEqualIID (lpcGUID, &IID_IDirectMusic2) ||
IsEqualIID (lpcGUID, &IID_IDirectMusic8)) {
dmusic = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusic8Impl));
if (NULL == dmusic) {
*ppDM = (LPDIRECTMUSIC8) NULL;
......@@ -328,7 +326,7 @@ HRESULT WINAPI DMUSIC_CreateDirectMusic (LPCGUID lpcGUID, LPDIRECTMUSIC8 *ppDM,
*ppDM = (LPDIRECTMUSIC8) dmusic;
return S_OK;
}
WARN("No interface found\n");
WARN("No interface found\n");
return E_NOINTERFACE;
}
......@@ -21,13 +21,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/******************************************************************
* DirectMusic ClassFactory
*
*
*/
typedef struct
{
/* IUnknown fields */
......@@ -35,7 +28,10 @@ typedef struct
DWORD ref;
} IClassFactoryImpl;
static HRESULT WINAPI DMCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
/******************************************************************
* DirectMusic ClassFactory
*/
static HRESULT WINAPI DirectMusicCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
......@@ -43,71 +39,108 @@ static HRESULT WINAPI DMCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOI
return E_NOINTERFACE;
}
static ULONG WINAPI DMCF_AddRef(LPCLASSFACTORY iface)
static ULONG WINAPI DirectMusicCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI DMCF_Release(LPCLASSFACTORY iface)
static ULONG WINAPI DirectMusicCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI DMCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
static HRESULT WINAPI DirectMusicCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualGUID (riid, &IID_IDirectMusic) ||
IsEqualGUID (riid, &IID_IDirectMusic2) ||
IsEqualGUID (riid, &IID_IDirectMusic8)) {
if (IsEqualIID (riid, &IID_IDirectMusic) ||
IsEqualIID (riid, &IID_IDirectMusic2) ||
IsEqualIID (riid, &IID_IDirectMusic8)) {
return DMUSIC_CreateDirectMusic (riid, (LPDIRECTMUSIC8*) ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicBuffer)) {
return DMUSIC_CreateDirectMusicBuffer (riid, (LPDIRECTMUSICBUFFER*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicInstrument)) {
return DMUSIC_CreateDirectMusicInstrument (riid, (LPDIRECTMUSICINSTRUMENT*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicDownloadedInstrument)) {
return DMUSIC_CreateDirectMusicDownloadedInstrument (riid, (LPDIRECTMUSICDOWNLOADEDINSTRUMENT*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicCollection)) {
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI DirectMusicCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) DirectMusicCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
DirectMusicCF_QueryInterface,
DirectMusicCF_AddRef,
DirectMusicCF_Release,
DirectMusicCF_CreateInstance,
DirectMusicCF_LockServer
};
static IClassFactoryImpl DirectMusic_CF = {&DirectMusicCF_Vtbl, 1 };
/******************************************************************
* DirectMusicCollection ClassFactory
*/
static HRESULT WINAPI CollectionCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
static ULONG WINAPI CollectionCF_AddRef(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
return ++(This->ref);
}
static ULONG WINAPI CollectionCF_Release(LPCLASSFACTORY iface)
{
ICOM_THIS(IClassFactoryImpl,iface);
/* static class, won't be freed */
return --(This->ref);
}
static HRESULT WINAPI CollectionCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IClassFactoryImpl,iface);
TRACE ("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
if (IsEqualIID (riid, &IID_IDirectMusicCollection)) {
return DMUSIC_CreateDirectMusicCollection (riid, (LPDIRECTMUSICCOLLECTION*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicDownload)) {
return DMUSIC_CreateDirectMusicDownload (riid, (LPDIRECTMUSICDOWNLOAD*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicPortDownload)) {
return DMUSIC_CreateDirectMusicPortDownload (riid, (LPDIRECTMUSICPORTDOWNLOAD*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicPort)) {
return DMUSIC_CreateDirectMusicPort (riid, (LPDIRECTMUSICPORT*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicThru)) {
return DMUSIC_CreateDirectMusicThru (riid, (LPDIRECTMUSICTHRU*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicObject (riid, (LPDIRECTMUSICOBJECT*)ppobj, pOuter);
} else if (IsEqualGUID (riid, &IID_IReferenceClock)) {
return DMUSIC_CreateReferenceClock (riid, (IReferenceClock**)ppobj, pOuter);
} else if (IsEqualIID (riid, &IID_IDirectMusicObject)) {
return DMUSIC_CreateDirectMusicCollectionObject (riid, (LPDIRECTMUSICOBJECT*)ppobj, pOuter);
}
WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
return E_NOINTERFACE;
}
static HRESULT WINAPI DMCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
static HRESULT WINAPI CollectionCF_LockServer(LPCLASSFACTORY iface,BOOL dolock)
{
ICOM_THIS(IClassFactoryImpl,iface);
FIXME("(%p)->(%d),stub!\n", This, dolock);
return S_OK;
}
static ICOM_VTABLE(IClassFactory) DMCF_Vtbl = {
static ICOM_VTABLE(IClassFactory) CollectionCF_Vtbl = {
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
DMCF_QueryInterface,
DMCF_AddRef,
DMCF_Release,
DMCF_CreateInstance,
DMCF_LockServer
CollectionCF_QueryInterface,
CollectionCF_AddRef,
CollectionCF_Release,
CollectionCF_CreateInstance,
CollectionCF_LockServer
};
static IClassFactoryImpl DMUSIC_CF = {&DMCF_Vtbl, 1 };
static IClassFactoryImpl Collection_CF = {&CollectionCF_Vtbl, 1 };
/******************************************************************
* DllMain
......@@ -151,11 +184,16 @@ HRESULT WINAPI DMUSIC_DllCanUnloadNow(void)
HRESULT WINAPI DMUSIC_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
TRACE("(%p,%p,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
if (IsEqualCLSID (&IID_IClassFactory, riid)) {
*ppv = (LPVOID) &DMUSIC_CF;
if (IsEqualCLSID (rclsid, &CLSID_DirectMusic) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &DirectMusic_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
} else if (IsEqualCLSID (rclsid, &CLSID_DirectMusicCollection) && IsEqualIID (riid, &IID_IClassFactory)) {
*ppv = (LPVOID) &Collection_CF;
IClassFactory_AddRef((IClassFactory*)*ppv);
return S_OK;
}
WARN("(%p,%p,%p): no interface found.\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
return CLASS_E_CLASSNOTAVAILABLE;
}
......@@ -43,9 +43,11 @@ typedef struct IDirectMusicDownloadImpl IDirectMusicDownloadImpl;
typedef struct IDirectMusicPortDownloadImpl IDirectMusicPortDownloadImpl;
typedef struct IDirectMusicPortImpl IDirectMusicPortImpl;
typedef struct IDirectMusicThruImpl IDirectMusicThruImpl;
typedef struct IDirectMusicObjectImpl IDirectMusicObjectImpl;
typedef struct IReferenceClockImpl IReferenceClockImpl;
typedef struct IDirectMusicCollectionObject IDirectMusicCollectionObject;
typedef struct IDirectMusicCollectionObjectStream IDirectMusicCollectionObjectStream;
/*****************************************************************************
* Predeclare the interface implementation structures
*/
......@@ -58,9 +60,11 @@ extern ICOM_VTABLE(IDirectMusicDownload) DirectMusicDownload_Vtbl;
extern ICOM_VTABLE(IDirectMusicPortDownload) DirectMusicPortDownload_Vtbl;
extern ICOM_VTABLE(IDirectMusicPort) DirectMusicPort_Vtbl;
extern ICOM_VTABLE(IDirectMusicThru) DirectMusicThru_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicObject_Vtbl;
extern ICOM_VTABLE(IReferenceClock) ReferenceClock_Vtbl;
extern ICOM_VTABLE(IDirectMusicObject) DirectMusicCollectionObject_Vtbl;
extern ICOM_VTABLE(IPersistStream) DirectMusicCollectionObjectStream_Vtbl;
/*****************************************************************************
* Some stuff to make my life easier :=)
*/
......@@ -241,12 +245,11 @@ extern HRESULT WINAPI DMUSIC_CreateDirectMusicThru (LPCGUID lpcGUID, LPDIRECTMUS
/* can support IID_IDirectMusicObject
* return always an IDirectMusicObjectImpl
*/
extern HRESULT WINAPI DMUSIC_CreateDirectMusicObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppDMObj, LPUNKNOWN pUnkOuter);
/* can support IID_IReferenceClock
* return always an IReferenceClockImpl
*/
extern HRESULT WINAPI DMUSIC_CreateReferenceClock (LPCGUID lpcGUID, IReferenceClock** ppDM, LPUNKNOWN pUnkOuter);
extern HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
/*****************************************************************************
* IDirectMusic8Impl implementation structure
*/
......@@ -320,7 +323,8 @@ struct IDirectMusicInstrumentImpl
DWORD ref;
/* IDirectMusicInstrumentImpl fields */
DWORD patch;
DWORD dwPatch;
LPWSTR pwszName;
};
/* IUnknown: */
......@@ -360,6 +364,9 @@ struct IDirectMusicCollectionImpl
DWORD ref;
/* IDirectMusicCollectionImpl fields */
IDirectMusicCollectionObject* pObject;
DWORD nrofinstruments;
IDirectMusicInstrumentImpl** ppInstruments;
};
/* IUnknown: */
......@@ -475,28 +482,6 @@ extern ULONG WINAPI IDirectMusicThruImpl_Release (LPDIRECTMUSICTHRU iface);
extern HRESULT WINAPI ThruChannel (LPDIRECTMUSICTHRU iface, DWORD dwSourceChannelGroup, DWORD dwSourceChannel, DWORD dwDestinationChannelGroup, DWORD dwDestinationChannel, LPDIRECTMUSICPORT pDestinationPort);
/*****************************************************************************
* IDirectMusicObjectImpl implementation structure
*/
struct IDirectMusicObjectImpl
{
/* IUnknown fields */
ICOM_VFIELD(IDirectMusicObject);
DWORD ref;
/* IDirectMusicObjectImpl fields */
LPDMUS_OBJECTDESC pDesc;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicObjectImpl_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicObjectImpl_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicObjectImpl_Release (LPDIRECTMUSICOBJECT iface);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicObjectImpl_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicObjectImpl_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicObjectImpl_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/*****************************************************************************
* IReferenceClockImpl implementation structure
*/
struct IReferenceClockImpl
......@@ -522,6 +507,56 @@ extern HRESULT WINAPI IReferenceClockImpl_Unadvise (IReferenceClock *iface, DWOR
/*****************************************************************************
* IDirectMusicCollectionObject implementation structure
*/
struct IDirectMusicCollectionObject
{
/* IUnknown fields */
ICOM_VFIELD (IDirectMusicObject);
DWORD ref;
/* IDirectMusicObjectImpl fields */
LPDMUS_OBJECTDESC pDesc;
IDirectMusicCollectionObjectStream* pStream;
IDirectMusicCollectionImpl* pCollection;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicCollectionObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
extern ULONG WINAPI IDirectMusicCollectionObject_AddRef (LPDIRECTMUSICOBJECT iface);
extern ULONG WINAPI IDirectMusicCollectionObject_Release (LPDIRECTMUSICOBJECT iface);
/* IDirectMusicObject: */
extern HRESULT WINAPI IDirectMusicCollectionObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicCollectionObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
extern HRESULT WINAPI IDirectMusicCollectionObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
/*****************************************************************************
* IDirectMusicCollectionObjectStream implementation structure
*/
struct IDirectMusicCollectionObjectStream
{
/* IUnknown fields */
ICOM_VFIELD (IPersistStream);
DWORD ref;
/* IPersistStreamImpl fields */
IDirectMusicCollectionObject* pParentObject;
};
/* IUnknown: */
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
extern ULONG WINAPI IDirectMusicCollectionObjectStream_AddRef (LPPERSISTSTREAM iface);
extern ULONG WINAPI IDirectMusicCollectionObjectStream_Release (LPPERSISTSTREAM iface);
/* IPersist: */
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
/* IPersistStream: */
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_IsDirty (LPPERSISTSTREAM iface);
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
extern HRESULT WINAPI IDirectMusicCollectionObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
/*****************************************************************************
* Helper Functions
*/
void register_waveport (LPGUID lpGUID, LPCSTR lpszDesc, LPCSTR lpszDrvName, LPVOID lpContext);
......
......@@ -41,12 +41,13 @@ HRESULT WINAPI IDirectMusicDownloadImpl_QueryInterface (LPDIRECTMUSICDOWNLOAD if
{
ICOM_THIS(IDirectMusicDownloadImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicDownload))
{
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicDownload)) {
IDirectMusicDownloadImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
......@@ -63,8 +64,7 @@ ULONG WINAPI IDirectMusicDownloadImpl_Release (LPDIRECTMUSICDOWNLOAD iface)
ICOM_THIS(IDirectMusicDownloadImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -92,12 +92,11 @@ ICOM_VTABLE(IDirectMusicDownload) DirectMusicDownload_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicDownload (LPCGUID lpcGUID, LPDIRECTMUSICDOWNLOAD* ppDMDL, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicDownload))
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicDownload)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
WARN("No interface found\n");
return E_NOINTERFACE;
}
......@@ -32,12 +32,13 @@ HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface (LPDIRECTMUSI
{
ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicDownloadedInstrument))
{
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicDownloadedInstrument)) {
IDirectMusicDownloadedInstrumentImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
......@@ -54,8 +55,7 @@ ULONG WINAPI IDirectMusicDownloadedInstrumentImpl_Release (LPDIRECTMUSICDOWNLOAD
ICOM_THIS(IDirectMusicDownloadedInstrumentImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -75,12 +75,11 @@ ICOM_VTABLE(IDirectMusicDownloadedInstrument) DirectMusicDownloadedInstrument_Vt
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicDownloadedInstrument (LPCGUID lpcGUID, LPDIRECTMUSICDOWNLOADEDINSTRUMENT* ppDMDLInstrument, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicDownloadedInstrument))
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicDownloadedInstrument)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
WARN("No interface found\n");
return E_NOINTERFACE;
}
......@@ -32,12 +32,13 @@ HRESULT WINAPI IDirectMusicInstrumentImpl_QueryInterface (LPDIRECTMUSICINSTRUMEN
{
ICOM_THIS(IDirectMusicInstrumentImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicInstrument))
{
if (IsEqualIID (riid, &IID_IUnknown)
|| IsEqualIID (riid, &IID_IDirectMusicInstrument)) {
IDirectMusicInstrumentImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
......@@ -54,8 +55,7 @@ ULONG WINAPI IDirectMusicInstrumentImpl_Release (LPDIRECTMUSICINSTRUMENT iface)
ICOM_THIS(IDirectMusicInstrumentImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
if (ref == 0) {
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
......@@ -67,7 +67,7 @@ HRESULT WINAPI IDirectMusicInstrumentImpl_GetPatch (LPDIRECTMUSICINSTRUMENT ifac
ICOM_THIS(IDirectMusicInstrumentImpl,iface);
TRACE("(%p, %p)\n", This, pdwPatch);
*pdwPatch = This->patch;
*pdwPatch = This->dwPatch;
return S_OK;
}
......@@ -77,7 +77,7 @@ HRESULT WINAPI IDirectMusicInstrumentImpl_SetPatch (LPDIRECTMUSICINSTRUMENT ifac
ICOM_THIS(IDirectMusicInstrumentImpl,iface);
TRACE("(%p, %ld)\n", This, dwPatch);
This->patch = dwPatch;
This->dwPatch = dwPatch;
return S_OK;
}
......@@ -95,12 +95,11 @@ ICOM_VTABLE(IDirectMusicInstrument) DirectMusicInstrument_Vtbl =
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicInstrument (LPCGUID lpcGUID, LPDIRECTMUSICINSTRUMENT* ppDMInstr, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicInstrument))
{
if (IsEqualIID (lpcGUID, &IID_IDirectMusicInstrument)) {
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
WARN("No interface found\n");
return E_NOINTERFACE;
}
/* IDirectMusicObject Implementation
*
* Copyright (C) 2003 Rok Mandeljc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winuser.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "mmsystem.h"
#include "winternl.h"
#include "mmddk.h"
#include "wine/windef16.h"
#include "wine/winbase16.h"
#include "wine/debug.h"
#include "dsound.h"
#include "dmusic_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
/* IDirectMusicObject IUnknown parts follow: */
HRESULT WINAPI IDirectMusicObjectImpl_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicObject))
{
IDirectMusicObjectImpl_AddRef(iface);
*ppobj = This;
return S_OK;
}
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
return E_NOINTERFACE;
}
ULONG WINAPI IDirectMusicObjectImpl_AddRef (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
return ++(This->ref);
}
ULONG WINAPI IDirectMusicObjectImpl_Release (LPDIRECTMUSICOBJECT iface)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
ULONG ref = --This->ref;
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0)
{
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* IDirectMusicObject Interface follow: */
HRESULT WINAPI IDirectMusicObjectImpl_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
TRACE("(%p, %p)\n", This, pDesc);
pDesc = This->pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicObjectImpl_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
TRACE("(%p, %p)\n", This, pDesc);
This->pDesc = pDesc;
return S_OK;
}
HRESULT WINAPI IDirectMusicObjectImpl_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc)
{
ICOM_THIS(IDirectMusicObjectImpl,iface);
FIXME("(%p, %p, %p): stub\n", This, pStream, pDesc);
return S_OK;
}
ICOM_VTABLE(IDirectMusicObject) DirectMusicObject_Vtbl =
{
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
IDirectMusicObjectImpl_QueryInterface,
IDirectMusicObjectImpl_AddRef,
IDirectMusicObjectImpl_Release,
IDirectMusicObjectImpl_GetDescriptor,
IDirectMusicObjectImpl_SetDescriptor,
IDirectMusicObjectImpl_ParseDescriptor
};
/* for ClassFactory */
HRESULT WINAPI DMUSIC_CreateDirectMusicObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppDMObj, LPUNKNOWN pUnkOuter)
{
if (IsEqualGUID (lpcGUID, &IID_IDirectMusicObject))
{
FIXME("Not yet\n");
return E_NOINTERFACE;
}
WARN("No interface found\n");
return E_NOINTERFACE;
}
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