From 12179978fb25e422ca4c5dc6768b7a7e332b24fb Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sat, 10 Jun 2006 11:56:03 +0200 Subject: [PATCH] dmloader: Make the virtual table functions static where possible. --- dlls/dmloader/classfactory.c | 24 +++-- dlls/dmloader/container.c | 40 ++++---- dlls/dmloader/dmloader_private.h | 46 --------- dlls/dmloader/loader.c | 36 +++---- dlls/dmloader/loaderstream.c | 156 ++++++++++++++----------------- 5 files changed, 125 insertions(+), 177 deletions(-) diff --git a/dlls/dmloader/classfactory.c b/dlls/dmloader/classfactory.c index 2bb5602b4f4..8a927b36df1 100644 --- a/dlls/dmloader/classfactory.c +++ b/dlls/dmloader/classfactory.c @@ -25,7 +25,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmloader); /***************************************************************************** * IDirectMusicLoaderCF implementation */ -HRESULT WINAPI IDirectMusicLoaderCF_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj) { +static ULONG WINAPI IDirectMusicLoaderCF_AddRef (LPCLASSFACTORY iface); + +static HRESULT WINAPI IDirectMusicLoaderCF_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj) { IDirectMusicLoaderCF *This = (IDirectMusicLoaderCF *)iface; TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); @@ -40,13 +42,13 @@ HRESULT WINAPI IDirectMusicLoaderCF_QueryInterface (LPCLASSFACTORY iface, REFIID return E_NOINTERFACE; } -ULONG WINAPI IDirectMusicLoaderCF_AddRef (LPCLASSFACTORY iface) { +static ULONG WINAPI IDirectMusicLoaderCF_AddRef (LPCLASSFACTORY iface) { IDirectMusicLoaderCF *This = (IDirectMusicLoaderCF *)iface; TRACE("(%p): AddRef from %ld\n", This, This->dwRef); return InterlockedIncrement (&This->dwRef); } -ULONG WINAPI IDirectMusicLoaderCF_Release (LPCLASSFACTORY iface) { +static ULONG WINAPI IDirectMusicLoaderCF_Release (LPCLASSFACTORY iface) { IDirectMusicLoaderCF *This = (IDirectMusicLoaderCF *)iface; DWORD dwRef = InterlockedDecrement (&This->dwRef); @@ -60,7 +62,7 @@ ULONG WINAPI IDirectMusicLoaderCF_Release (LPCLASSFACTORY iface) { return dwRef; } -HRESULT WINAPI IDirectMusicLoaderCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { +static HRESULT WINAPI IDirectMusicLoaderCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { IDirectMusicLoaderCF *This = (IDirectMusicLoaderCF *)iface; TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj); @@ -72,7 +74,7 @@ HRESULT WINAPI IDirectMusicLoaderCF_CreateInstance (LPCLASSFACTORY iface, LPUNKN return DMUSIC_CreateDirectMusicLoaderImpl (riid, ppobj, pOuter); } -HRESULT WINAPI IDirectMusicLoaderCF_LockServer (LPCLASSFACTORY iface, BOOL dolock) { +static HRESULT WINAPI IDirectMusicLoaderCF_LockServer (LPCLASSFACTORY iface, BOOL dolock) { IDirectMusicLoaderCF *This = (IDirectMusicLoaderCF *)iface; TRACE("(%p, %d)\n", This, dolock); if (dolock) @@ -112,7 +114,9 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderCF (LPCGUID lpcGUID, LPVOID *ppobj, /***************************************************************************** * IDirectMusicContainerCF implementation */ -HRESULT WINAPI IDirectMusicContainerCF_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj) { +static ULONG WINAPI IDirectMusicContainerCF_AddRef (LPCLASSFACTORY iface); + +static HRESULT WINAPI IDirectMusicContainerCF_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppobj) { IDirectMusicContainerCF *This = (IDirectMusicContainerCF *)iface; TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); @@ -127,13 +131,13 @@ HRESULT WINAPI IDirectMusicContainerCF_QueryInterface (LPCLASSFACTORY iface, REF return E_NOINTERFACE; } -ULONG WINAPI IDirectMusicContainerCF_AddRef (LPCLASSFACTORY iface) { +static ULONG WINAPI IDirectMusicContainerCF_AddRef (LPCLASSFACTORY iface) { IDirectMusicContainerCF *This = (IDirectMusicContainerCF *)iface; TRACE("(%p): AddRef from %ld\n", This, This->dwRef); return InterlockedIncrement (&This->dwRef); } -ULONG WINAPI IDirectMusicContainerCF_Release (LPCLASSFACTORY iface) { +static ULONG WINAPI IDirectMusicContainerCF_Release (LPCLASSFACTORY iface) { IDirectMusicContainerCF *This = (IDirectMusicContainerCF *)iface; DWORD dwRef = InterlockedDecrement (&This->dwRef); @@ -147,7 +151,7 @@ ULONG WINAPI IDirectMusicContainerCF_Release (LPCLASSFACTORY iface) { return dwRef; } -HRESULT WINAPI IDirectMusicContainerCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { +static HRESULT WINAPI IDirectMusicContainerCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj) { IDirectMusicContainerCF *This = (IDirectMusicContainerCF *)iface; TRACE ("(%p, %p, %s, %p)\n", This, pOuter, debugstr_dmguid(riid), ppobj); @@ -159,7 +163,7 @@ HRESULT WINAPI IDirectMusicContainerCF_CreateInstance (LPCLASSFACTORY iface, LPU return DMUSIC_CreateDirectMusicContainerImpl (riid, ppobj, pOuter); } -HRESULT WINAPI IDirectMusicContainerCF_LockServer (LPCLASSFACTORY iface, BOOL dolock) { +static HRESULT WINAPI IDirectMusicContainerCF_LockServer (LPCLASSFACTORY iface, BOOL dolock) { IDirectMusicContainerCF *This = (IDirectMusicContainerCF *)iface; TRACE("(%p, %d)\n", This, dolock); if (dolock) diff --git a/dlls/dmloader/container.c b/dlls/dmloader/container.c index 952905810f5..2eda4265829 100644 --- a/dlls/dmloader/container.c +++ b/dlls/dmloader/container.c @@ -27,11 +27,15 @@ WINE_DECLARE_DEBUG_CHANNEL(dmdump); #define DMUS_MAX_NAME_SIZE DMUS_MAX_NAME*sizeof(WCHAR) #define DMUS_MAX_FILENAME_SIZE DMUS_MAX_FILENAME*sizeof(WCHAR) +static ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_AddRef (LPDIRECTMUSICCONTAINER iface); +static ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface); +static ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface); + /***************************************************************************** * IDirectMusicContainerImpl implementation */ /* IUnknown/IDirectMusicContainer part: */ -HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj) { +static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); @@ -54,13 +58,13 @@ HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface (L return E_NOINTERFACE; } -ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_AddRef (LPDIRECTMUSICCONTAINER iface) { +static ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_AddRef (LPDIRECTMUSICCONTAINER iface) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); TRACE("(%p): AddRef from %ld\n", This, This->dwRef); return InterlockedIncrement (&This->dwRef); } -ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_Release (LPDIRECTMUSICCONTAINER iface) { +static ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_Release (LPDIRECTMUSICCONTAINER iface) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); DWORD dwRef = InterlockedDecrement (&This->dwRef); @@ -73,7 +77,7 @@ ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_Release (LPDIRECTMU return dwRef; } -HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias) { +static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); struct list *pEntry; LPWINE_CONTAINER_ENTRY pContainedObject; @@ -135,22 +139,22 @@ static const IDirectMusicContainerVtbl DirectMusicContainer_Container_Vtbl = { }; /* IDirectMusicObject part: */ -HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) { +static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); return IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface ((LPDIRECTMUSICCONTAINER)&This->ContainerVtbl, riid, ppobj); } -ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) { +static ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); return IDirectMusicContainerImpl_IDirectMusicContainer_AddRef ((LPDIRECTMUSICCONTAINER)&This->ContainerVtbl); } -ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) { +static ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); return IDirectMusicContainerImpl_IDirectMusicContainer_Release ((LPDIRECTMUSICCONTAINER)&This->ContainerVtbl); } -HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { +static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); TRACE("(%p, %p):\n", This, pDesc); @@ -174,7 +178,7 @@ HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_GetDescriptor (LPDIR return S_OK; } -HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { +static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { DWORD dwNewFlags = 0; DWORD dwFlagDifference; ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); @@ -230,7 +234,7 @@ HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_SetDescriptor (LPDIR } else return S_OK; } -HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) { +static HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, ObjectVtbl, iface); WINE_CHUNK Chunk; DWORD StreamSize, StreamCount, ListSize[1], ListCount[1]; @@ -407,22 +411,22 @@ static const IDirectMusicObjectVtbl DirectMusicContainer_Object_Vtbl = { }; /* IPersistStream part: */ -HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) { +static HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, PersistStreamVtbl, iface); return IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface ((LPDIRECTMUSICCONTAINER)&This->ContainerVtbl, riid, ppobj); } -ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) { +static ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, PersistStreamVtbl, iface); return IDirectMusicContainerImpl_IDirectMusicContainer_AddRef ((LPDIRECTMUSICCONTAINER)&This->ContainerVtbl); } -ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_Release (LPPERSISTSTREAM iface) { +static ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_Release (LPPERSISTSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, PersistStreamVtbl, iface); return IDirectMusicContainerImpl_IDirectMusicContainer_Release ((LPDIRECTMUSICCONTAINER)&This->ContainerVtbl); } -HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) { +static HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, PersistStreamVtbl, iface); TRACE("(%p, %p)\n", This, pClassID); @@ -435,12 +439,12 @@ HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetClassID (LPPERSISTSTR return S_OK; } -HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) { +static HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) { /* FIXME: is implemented (somehow) */ return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) { +static HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) { ICOM_THIS_MULTI(IDirectMusicContainerImpl, PersistStreamVtbl, iface); WINE_CHUNK Chunk; DWORD StreamSize, StreamCount, ListSize[3], ListCount[3]; @@ -858,12 +862,12 @@ HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Load (LPPERSISTSTREAM if return result; } -HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) { +static HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) { +static HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) { ERR(": should not be needed\n"); return E_NOTIMPL; } diff --git a/dlls/dmloader/dmloader_private.h b/dlls/dmloader/dmloader_private.h index a6c9dc928da..c5f8c561b04 100644 --- a/dlls/dmloader/dmloader_private.h +++ b/dlls/dmloader/dmloader_private.h @@ -73,13 +73,8 @@ extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LP extern HRESULT WINAPI DMUSIC_DestroyDirectMusicContainerImpl(LPDIRECTMUSICCONTAINER iface); extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderFileStream (LPVOID *ppobj); -extern HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderFileStream (LPSTREAM iface); - extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderResourceStream (LPVOID *ppobj); -extern HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderResourceStream (LPSTREAM iface); - extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderGenericStream (LPVOID *ppobj); -extern HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderGenericStream (LPSTREAM iface); /***************************************************************************** * IDirectMusicLoaderCF implementation structure @@ -90,10 +85,6 @@ struct IDirectMusicLoaderCF { LONG dwRef; }; -/* IUnknown / IClassFactory: */ -extern HRESULT WINAPI IDirectMusicLoaderCF_QueryInterface (LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicLoaderCF_AddRef (LPCLASSFACTORY iface); - /***************************************************************************** * IDirectMusicContainerCF implementation structure */ @@ -103,10 +94,6 @@ struct IDirectMusicContainerCF { LONG dwRef; }; -/* IUnknown / IClassFactory: */ -extern HRESULT WINAPI IDirectMusicContainerCF_QueryInterface (LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicContainerCF_AddRef (LPCLASSFACTORY iface); - /* cache/alias entry */ typedef struct _WINE_LOADER_ENTRY { struct list entry; /* for listing elements */ @@ -139,10 +126,6 @@ struct IDirectMusicLoaderImpl { CRITICAL_SECTION CritSect; }; -/* IUnknown / IDirectMusicLoader(8): */ -extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_AddRef (LPDIRECTMUSICLOADER8 iface); - /* contained object entry */ typedef struct _WINE_CONTAINER_ENTRY { struct list entry; /* for listing elements */ @@ -173,16 +156,6 @@ struct IDirectMusicContainerImpl { DMUS_OBJECTDESC Desc; }; -/* IUnknown / IDirectMusicContainer: */ -extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_AddRef (LPDIRECTMUSICCONTAINER iface); -/* IDirectMusicObject: */ -extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj); -extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface); -/* IPersistStream: */ -extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject); -extern ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface); - /***************************************************************************** * IDirectMusicLoaderFileStream implementation structure */ @@ -202,12 +175,6 @@ struct IDirectMusicLoaderFileStream { /* Custom: */ extern HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFile, LPDIRECTMUSICLOADER8 pLoader); extern void WINAPI IDirectMusicLoaderFileStream_Detach (LPSTREAM iface); -/* IUnknown/IStream: */ -extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj); -extern ULONG WINAPI IDirectMusicLoaderFileStream_IStream_AddRef (LPSTREAM iface); -/* IDirectMusicGetLoader: */ -extern HRESULT WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj); -extern ULONG WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface); /***************************************************************************** * IDirectMusicLoaderResourceStream implementation structure @@ -230,12 +197,6 @@ struct IDirectMusicLoaderResourceStream { /* Custom: */ extern HRESULT WINAPI IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface, LPBYTE pbMemData, LONGLONG llMemLength, LONGLONG llPos, LPDIRECTMUSICLOADER8 pLoader); extern void WINAPI IDirectMusicLoaderResourceStream_Detach (LPSTREAM iface); -/* IUnknown/IStream: */ -extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj); -extern ULONG WINAPI IDirectMusicLoaderResourceStream_IStream_AddRef (LPSTREAM iface); -/* IDirectMusicGetLoader: */ -extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj); -extern ULONG WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface); /***************************************************************************** * IDirectMusicLoaderGenericStream implementation structure @@ -255,12 +216,6 @@ struct IDirectMusicLoaderGenericStream { /* Custom: */ extern HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM pStream, LPDIRECTMUSICLOADER8 pLoader); extern void WINAPI IDirectMusicLoaderGenericStream_Detach (LPSTREAM iface); -/* IUnknown/IStream: */ -extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj); -extern ULONG WINAPI IDirectMusicLoaderGenericStream_IStream_AddRef (LPSTREAM iface); -/* IDirectMusicGetLoader: */ -extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj); -extern ULONG WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface); /***************************************************************************** * Misc. @@ -273,7 +228,6 @@ typedef struct _WINE_CHUNK { extern HRESULT WINAPI DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]); extern HRESULT WINAPI DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache); -extern HRESULT WINAPI DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache); extern HRESULT WINAPI DMUSIC_InitLoaderSettings (LPDIRECTMUSICLOADER8 iface); extern HRESULT WINAPI DMUSIC_CopyDescriptor (LPDMUS_OBJECTDESC pDst, LPDMUS_OBJECTDESC pSrc); extern BOOL WINAPI DMUSIC_IsValidLoadableClass (REFCLSID pClassID); diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c index e11b9a224a5..c429b81d85b 100644 --- a/dlls/dmloader/loader.c +++ b/dlls/dmloader/loader.c @@ -21,11 +21,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmloader); +static HRESULT WINAPI DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache); + /***************************************************************************** * IDirectMusicLoaderImpl implementation */ /* IUnknown/IDirectMusicLoader(8) part: */ -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj) { +static ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_AddRef (LPDIRECTMUSICLOADER8 iface); + +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); TRACE("(%p, %s, %p)\n",This, debugstr_dmguid(riid), ppobj); @@ -41,13 +45,13 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface (LPDIREC return E_NOINTERFACE; } -ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_AddRef (LPDIRECTMUSICLOADER8 iface) { +static ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_AddRef (LPDIRECTMUSICLOADER8 iface) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); TRACE("(%p): AddRef from %ld\n", This, This->dwRef); return InterlockedIncrement (&This->dwRef); } -ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_Release (LPDIRECTMUSICLOADER8 iface) { +static ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_Release (LPDIRECTMUSICLOADER8 iface) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); DWORD dwRef = InterlockedDecrement (&This->dwRef); @@ -60,7 +64,7 @@ ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_Release (LPDIRECTMUSICLOA return dwRef; } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_GetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID* ppv) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_GetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID* ppv) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); HRESULT result = S_OK; HRESULT ret = S_OK; /* used at the end of function, to determine whether everything went OK */ @@ -318,7 +322,7 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_GetObject (LPDIRECTMUSI return result; } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); LPSTREAM pStream; LPDIRECTMUSICOBJECT pObject; @@ -440,7 +444,7 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetObject (LPDIRECTMUSI return S_OK; } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetSearchDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetSearchDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear) { WCHAR wszCurrentPath[MAX_PATH]; ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); TRACE("(%p, %s, %s, %d)\n", This, debugstr_dmguid(rguidClass), debugstr_w(pwzPath), fClear); @@ -453,7 +457,7 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetSearchDirectory (LPD return DMUSIC_SetLoaderSettings (iface, rguidClass, pwzPath, NULL); } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ScanDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ScanDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName) { static const WCHAR wszAny[] = {'*',0}; WIN32_FIND_DATAW FileData; HANDLE hSearch; @@ -507,7 +511,7 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ScanDirectory (LPDIRECT } while (1); } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_CacheObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_CacheObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject) { DMUS_OBJECTDESC Desc; HRESULT result = DMUS_E_LOADER_OBJECTNOTFOUND; struct list *pEntry; @@ -587,7 +591,7 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_CacheObject (LPDIRECTMU return result; } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject) { DMUS_OBJECTDESC Desc; struct list *pEntry; LPWINE_LOADER_ENTRY pObjectEntry = NULL; @@ -650,7 +654,7 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObject (LPDIRECT return result; } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ClearCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ClearCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass) { struct list *pEntry; LPWINE_LOADER_ENTRY pObjectEntry; ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); @@ -669,7 +673,7 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ClearCache (LPDIRECTMUS return S_OK; } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnableCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, BOOL fEnable) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnableCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, BOOL fEnable) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); BOOL bCurrent; TRACE("(%p, %s, %d)\n", This, debugstr_dmguid(rguidClass), fEnable); @@ -680,7 +684,7 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnableCache (LPDIRECTMU return DMUSIC_SetLoaderSettings (iface, rguidClass, NULL, &fEnable); } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnumObject (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnumObject (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc) { DWORD dwCount = 0; struct list *pEntry; LPWINE_LOADER_ENTRY pObjectEntry; @@ -710,12 +714,12 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnumObject (LPDIRECTMUS return S_FALSE; } -void WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_CollectGarbage (LPDIRECTMUSICLOADER8 iface) { +static void WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_CollectGarbage (LPDIRECTMUSICLOADER8 iface) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); FIXME("(%p): stub\n", This); } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObjectByUnknown (LPDIRECTMUSICLOADER8 iface, IUnknown* pObject) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObjectByUnknown (LPDIRECTMUSICLOADER8 iface, IUnknown* pObject) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); HRESULT result; LPDIRECTMUSICOBJECT pObjectInterface; @@ -736,7 +740,7 @@ HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObjectByUnknown return result; } -HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_LoadObjectFromFile (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClassID, REFIID iidInterfaceID, WCHAR* pwzFilePath, void** ppObject) { +static HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_LoadObjectFromFile (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClassID, REFIID iidInterfaceID, WCHAR* pwzFilePath, void** ppObject) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); DMUS_OBJECTDESC ObjDesc; WCHAR wszLoaderSearchPath[MAX_PATH]; @@ -887,7 +891,7 @@ HRESULT WINAPI DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pCl } /* help function for setting search path and caching option for certain class */ -HRESULT WINAPI DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache) { +static HRESULT WINAPI DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache) { ICOM_THIS_MULTI(IDirectMusicLoaderImpl, LoaderVtbl, iface); struct list *pEntry; HRESULT result = S_FALSE; /* in case pClassID != GUID_DirectMusicAllTypes and not a valid CLSID */ diff --git a/dlls/dmloader/loaderstream.c b/dlls/dmloader/loaderstream.c index 9183c345641..47b317c42f9 100644 --- a/dlls/dmloader/loaderstream.c +++ b/dlls/dmloader/loaderstream.c @@ -52,6 +52,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmloader); WINE_DECLARE_DEBUG_CHANNEL(dmfileraw); +static ULONG WINAPI IDirectMusicLoaderFileStream_IStream_AddRef (LPSTREAM iface); +static ULONG WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface); +static ULONG WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface); +static ULONG WINAPI IDirectMusicLoaderResourceStream_IStream_AddRef (LPSTREAM iface); +static ULONG WINAPI IDirectMusicLoaderGenericStream_IStream_AddRef (LPSTREAM iface); +static ULONG WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface); + + /***************************************************************************** * IDirectMusicLoaderFileStream implementation */ @@ -83,7 +91,7 @@ void WINAPI IDirectMusicLoaderFileStream_Detach (LPSTREAM iface) { /* IUnknown/IStream part: */ -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); @@ -102,25 +110,27 @@ HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_QueryInterface (LPSTREAM ifa return E_NOINTERFACE; } -ULONG WINAPI IDirectMusicLoaderFileStream_IStream_AddRef (LPSTREAM iface) { +static ULONG WINAPI IDirectMusicLoaderFileStream_IStream_AddRef (LPSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); TRACE("(%p): AddRef from %ld\n", This, This->dwRef); return InterlockedIncrement (&This->dwRef); } -ULONG WINAPI IDirectMusicLoaderFileStream_IStream_Release (LPSTREAM iface) { +static ULONG WINAPI IDirectMusicLoaderFileStream_IStream_Release (LPSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); DWORD dwRef = InterlockedDecrement (&This->dwRef); TRACE("(%p): ReleaseRef to %ld\n", This, dwRef); if (dwRef == 0) { - DMUSIC_DestroyDirectMusicLoaderFileStream (iface); + if (This->hFile) + IDirectMusicLoaderFileStream_Detach (iface); + HeapFree (GetProcessHeap(), 0, This); } return dwRef; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Read (LPSTREAM iface, void* pv, ULONG cb, ULONG* pcbRead) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Read (LPSTREAM iface, void* pv, ULONG cb, ULONG* pcbRead) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); ULONG cbRead; @@ -133,7 +143,7 @@ HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Read (LPSTREAM iface, void* return S_OK; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); LARGE_INTEGER liNewPos; @@ -150,7 +160,7 @@ HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Seek (LPSTREAM iface, LARGE_ return S_OK; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Clone (LPSTREAM iface, IStream** ppstm) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Clone (LPSTREAM iface, IStream** ppstm) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); LPSTREAM pOther = NULL; HRESULT result; @@ -182,7 +192,7 @@ HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Clone (LPSTREAM iface, IStre return S_OK; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); ULONG cbWrite; @@ -195,37 +205,37 @@ HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Write (LPSTREAM iface, const return S_OK; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Revert (LPSTREAM iface) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Revert (LPSTREAM iface) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag) { ERR(": should not be needed\n"); return E_NOTIMPL; } @@ -248,22 +258,22 @@ static const IStreamVtbl DirectMusicLoaderFileStream_Stream_Vtbl = { }; /* IDirectMusicGetLoader part: */ -HRESULT WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, GetLoaderVtbl, iface); return IDirectMusicLoaderFileStream_IStream_QueryInterface ((LPSTREAM)&This->StreamVtbl, riid, ppobj); } -ULONG WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface) { +static ULONG WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, GetLoaderVtbl, iface); return IDirectMusicLoaderFileStream_IStream_AddRef ((LPSTREAM)&This->StreamVtbl); } -ULONG WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface) { +static ULONG WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, GetLoaderVtbl, iface); return IDirectMusicLoaderFileStream_IStream_Release ((LPSTREAM)&This->StreamVtbl); } -HRESULT WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader) { +static HRESULT WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader) { ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, GetLoaderVtbl, iface); TRACE("(%p, %p)\n", This, ppLoader); @@ -296,17 +306,6 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderFileStream (LPVOID* ppobj) { return IDirectMusicLoaderFileStream_IStream_QueryInterface ((LPSTREAM)&obj->StreamVtbl, &IID_IStream, ppobj); } -HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderFileStream (LPSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicLoaderFileStream, StreamVtbl, iface); - - TRACE("(%p)\n", iface); - if (This->hFile) - IDirectMusicLoaderFileStream_Detach (iface); - HeapFree (GetProcessHeap(), 0, This); - - return S_OK; -} - /***************************************************************************** * IDirectMusicLoaderResourceStream implementation @@ -339,7 +338,7 @@ void WINAPI IDirectMusicLoaderResourceStream_Detach (LPSTREAM iface) { /* IUnknown/IStream part: */ -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); @@ -358,25 +357,26 @@ HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_QueryInterface (LPSTREAM return E_NOINTERFACE; } -ULONG WINAPI IDirectMusicLoaderResourceStream_IStream_AddRef (LPSTREAM iface) { +static ULONG WINAPI IDirectMusicLoaderResourceStream_IStream_AddRef (LPSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); TRACE("(%p): AddRef from %ld\n", This, This->dwRef); return InterlockedIncrement (&This->dwRef); } -ULONG WINAPI IDirectMusicLoaderResourceStream_IStream_Release (LPSTREAM iface) { +static ULONG WINAPI IDirectMusicLoaderResourceStream_IStream_Release (LPSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); DWORD dwRef = InterlockedDecrement (&This->dwRef); TRACE("(%p): ReleaseRef to %ld\n", This, dwRef); if (dwRef == 0) { - DMUSIC_DestroyDirectMusicLoaderResourceStream (iface); + IDirectMusicLoaderResourceStream_Detach (iface); + HeapFree (GetProcessHeap(), 0, This); } return dwRef; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Read (LPSTREAM iface, void* pv, ULONG cb, ULONG* pcbRead) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Read (LPSTREAM iface, void* pv, ULONG cb, ULONG* pcbRead) { LPBYTE pByte; ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); @@ -396,7 +396,7 @@ HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Read (LPSTREAM iface, vo return S_OK; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); TRACE_(dmfileraw)("(%p, 0x%08llX, %s, %p)\n", This, dlibMove.QuadPart, resolve_STREAM_SEEK(dwOrigin), plibNewPosition); @@ -440,7 +440,7 @@ HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Seek (LPSTREAM iface, LA return S_OK; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Clone (LPSTREAM iface, IStream** ppstm) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Clone (LPSTREAM iface, IStream** ppstm) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); LPSTREAM pOther = NULL; HRESULT result; @@ -456,42 +456,42 @@ HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Clone (LPSTREAM iface, I return S_OK; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Revert (LPSTREAM iface) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Revert (LPSTREAM iface) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { ERR(": should not be needed\n"); return E_NOTIMPL; } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag) { ERR(": should not be needed\n"); return E_NOTIMPL; } @@ -514,22 +514,22 @@ static const IStreamVtbl DirectMusicLoaderResourceStream_Stream_Vtbl = { }; /* IDirectMusicGetLoader part: */ -HRESULT WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, GetLoaderVtbl, iface); return IDirectMusicLoaderResourceStream_IStream_QueryInterface ((LPSTREAM)&This->StreamVtbl, riid, ppobj); } -ULONG WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface) { +static ULONG WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, GetLoaderVtbl, iface); return IDirectMusicLoaderResourceStream_IStream_AddRef ((LPSTREAM)&This->StreamVtbl); } -ULONG WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface) { +static ULONG WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, GetLoaderVtbl, iface); return IDirectMusicLoaderResourceStream_IStream_Release ((LPSTREAM)&This->StreamVtbl); } -HRESULT WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader) { +static HRESULT WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader) { ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, GetLoaderVtbl, iface); TRACE("(%p, %p)\n", This, ppLoader); @@ -562,15 +562,6 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderResourceStream (LPVOID* ppobj) { return IDirectMusicLoaderResourceStream_IStream_QueryInterface ((LPSTREAM)&obj->StreamVtbl, &IID_IStream, ppobj); } -HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderResourceStream (LPSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicLoaderResourceStream, StreamVtbl, iface); - - TRACE("(%p)\n", iface); - IDirectMusicLoaderResourceStream_Detach (iface); - HeapFree (GetProcessHeap(), 0, This); - - return S_OK; -} /***************************************************************************** * IDirectMusicLoaderGenericStream implementation @@ -606,7 +597,7 @@ void WINAPI IDirectMusicLoaderGenericStream_Detach (LPSTREAM iface) { /* IUnknown/IStream part: */ -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); @@ -625,25 +616,26 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_QueryInterface (LPSTREAM return E_NOINTERFACE; } -ULONG WINAPI IDirectMusicLoaderGenericStream_IStream_AddRef (LPSTREAM iface) { +static ULONG WINAPI IDirectMusicLoaderGenericStream_IStream_AddRef (LPSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p): AddRef from %ld\n", This, This->dwRef); return InterlockedIncrement (&This->dwRef); } -ULONG WINAPI IDirectMusicLoaderGenericStream_IStream_Release (LPSTREAM iface) { +static ULONG WINAPI IDirectMusicLoaderGenericStream_IStream_Release (LPSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); DWORD dwRef = InterlockedDecrement (&This->dwRef); TRACE("(%p): ReleaseRef to %ld\n", This, dwRef); if (dwRef == 0) { - DMUSIC_DestroyDirectMusicLoaderGenericStream (iface); + IDirectMusicLoaderGenericStream_Detach (iface); + HeapFree (GetProcessHeap(), 0, This); } return dwRef; } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Read (LPSTREAM iface, void* pv, ULONG cb, ULONG* pcbRead) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Read (LPSTREAM iface, void* pv, ULONG cb, ULONG* pcbRead) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE_(dmfileraw)("(%p, %p, 0x%08lX, %p): redirecting to low-level stream\n", This, pv, cb, pcbRead); @@ -653,7 +645,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Read (LPSTREAM iface, voi return IStream_Read (This->pStream, pv, cb, pcbRead); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE_(dmfileraw)("(%p, 0x%08llX, %s, %p): redirecting to low-level stream\n", This, dlibMove.QuadPart, resolve_STREAM_SEEK(dwOrigin), plibNewPosition); if (!This->pStream) @@ -662,7 +654,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Seek (LPSTREAM iface, LAR return IStream_Seek (This->pStream, dlibMove, dwOrigin, plibNewPosition); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Clone (LPSTREAM iface, IStream** ppstm) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Clone (LPSTREAM iface, IStream** ppstm) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); LPSTREAM pOther = NULL; LPSTREAM pLowLevel = NULL; @@ -682,7 +674,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Clone (LPSTREAM iface, IS return S_OK; } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE_(dmfileraw)("(%p, %p, 0x%08lX, %p): redirecting to low-level stream\n", This, pv, cb, pcbWritten); if (!This->pStream) @@ -691,7 +683,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Write (LPSTREAM iface, co return IStream_Write (This->pStream, pv, cb, pcbWritten); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p, 0x%08llX): redirecting to low-level stream\n", This, libNewSize.QuadPart); if (!This->pStream) @@ -700,7 +692,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_SetSize (LPSTREAM iface, return IStream_SetSize (This->pStream, libNewSize); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p, %p, 0x%08llX, %p, %p): redirecting to low-level stream\n", This, pstm, cb.QuadPart, pcbRead, pcbWritten); if (!This->pStream) @@ -709,7 +701,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_CopyTo (LPSTREAM iface, I return IStream_CopyTo (This->pStream, pstm, cb, pcbRead, pcbWritten); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p, 0x%08lX): redirecting to low-level stream\n", This, grfCommitFlags); if (!This->pStream) @@ -718,7 +710,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Commit (LPSTREAM iface, D return IStream_Commit (This->pStream, grfCommitFlags); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Revert (LPSTREAM iface) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Revert (LPSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p): redirecting to low-level stream\n", This); if (!This->pStream) @@ -727,7 +719,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Revert (LPSTREAM iface) { return IStream_Revert (This->pStream); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p, 0x%08llX, 0x%08llX, 0x%08lX): redirecting to low-level stream\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType); if (!This->pStream) @@ -736,7 +728,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_LockRegion (LPSTREAM ifac return IStream_LockRegion (This->pStream, libOffset, cb, dwLockType); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p, 0x%08llX, 0x%08llX, 0x%08lX): redirecting to low-level stream\n", This, libOffset.QuadPart, cb.QuadPart, dwLockType); if (!This->pStream) @@ -745,7 +737,7 @@ HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_UnlockRegion (LPSTREAM if return IStream_UnlockRegion (This->pStream, libOffset, cb, dwLockType); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); TRACE("(%p, %p, 0x%08lX): redirecting to low-level stream\n", This, pstatstg, grfStatFlag); if (!This->pStream) @@ -772,22 +764,22 @@ static const IStreamVtbl DirectMusicLoaderGenericStream_Stream_Vtbl = { }; /* IDirectMusicGetLoader part: */ -HRESULT WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, GetLoaderVtbl, iface); return IDirectMusicLoaderGenericStream_IStream_QueryInterface ((LPSTREAM)&This->StreamVtbl, riid, ppobj); } -ULONG WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface) { +static ULONG WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, GetLoaderVtbl, iface); return IDirectMusicLoaderGenericStream_IStream_AddRef ((LPSTREAM)&This->StreamVtbl); } -ULONG WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface) { +static ULONG WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, GetLoaderVtbl, iface); return IDirectMusicLoaderGenericStream_IStream_Release ((LPSTREAM)&This->StreamVtbl); } -HRESULT WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader) { +static HRESULT WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader) { ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, GetLoaderVtbl, iface); TRACE("(%p, %p)\n", This, ppLoader); @@ -819,13 +811,3 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderGenericStream (LPVOID* ppobj) { return IDirectMusicLoaderGenericStream_IStream_QueryInterface ((LPSTREAM)&obj->StreamVtbl, &IID_IStream, ppobj); } - -HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderGenericStream (LPSTREAM iface) { - ICOM_THIS_MULTI(IDirectMusicLoaderGenericStream, StreamVtbl, iface); - - TRACE("(%p)\n", iface); - IDirectMusicLoaderGenericStream_Detach (iface); - HeapFree (GetProcessHeap(), 0, This); - - return S_OK; -}