1 /* DirectMusicLoader Private Include
3 * Copyright (C) 2003 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __WINE_DMLOADER_PRIVATE_H
21 #define __WINE_DMLOADER_PRIVATE_H
24 #include "wine/debug.h"
35 typedef struct _DMUS_PRIVATE_CACHE_ENTRY
38 WCHAR pwzFileName[MAX_PATH];
39 IDirectMusicObject* pObject;
40 } DMUS_PRIVATE_CACHE_ENTRY, *LPDMUS_PRIVATE_CACHE_ENTRY;
42 typedef struct _DMUS_PRIVATE_OBJECT_REFERENCE DMUS_PRIVATE_OBJECT_REFERENCE;
44 struct _DMUS_PRIVATE_OBJECT_REFERENCE {
45 DMUS_PRIVATE_OBJECT_REFERENCE* pNext;
46 WCHAR pwsFileName[MAX_PATH];
48 IDirectMusicObject* pObject;
51 /*****************************************************************************
54 typedef struct IDirectMusicLoader8Impl IDirectMusicLoader8Impl;
55 typedef struct IDirectMusicContainerImpl IDirectMusicContainerImpl;
57 typedef struct IDirectMusicContainerObject IDirectMusicContainerObject;
58 typedef struct IDirectMusicContainerObjectStream IDirectMusicContainerObjectStream;
60 typedef struct ILoaderStream ILoaderStream;
62 /*****************************************************************************
63 * Predeclare the interface implementation structures
65 extern ICOM_VTABLE(IDirectMusicLoader8) DirectMusicLoader8_Vtbl;
66 extern ICOM_VTABLE(IDirectMusicContainer) DirectMusicContainer_Vtbl;
68 extern ICOM_VTABLE(IDirectMusicObject) DirectMusicContainerObject_Vtbl;
69 extern ICOM_VTABLE(IPersistStream) DirectMusicContainerObjectStream_Vtbl;
71 extern ICOM_VTABLE(IUnknown) LoaderStream_Unknown_Vtbl;
72 extern ICOM_VTABLE(IStream) LoaderStream_Stream_Vtbl;
73 extern ICOM_VTABLE(IDirectMusicGetLoader) LoaderStream_GetLoader_Vtbl;
75 /*****************************************************************************
78 /* can support IID_IDirectMusicLoader and IID_IDirectMusicLoader8
79 * return always an IDirectMusicLoader8Impl
81 extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoader (LPCGUID lpcGUID, LPDIRECTMUSICLOADER8 *ppDMLoad, LPUNKNOWN pUnkOuter);
82 /* can support IID_IDirectMusicContainer
83 * return always an IDirectMusicContainerImpl
85 extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainer (LPCGUID lpcGUID, LPDIRECTMUSICCONTAINER *ppDMCon, LPUNKNOWN pUnkOuter);
87 extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerObject (LPCGUID lpcGUID, LPDIRECTMUSICOBJECT* ppObject, LPUNKNOWN pUnkOuter);
89 extern HRESULT WINAPI DMUSIC_CreateLoaderStream (LPSTREAM *ppStream);
91 /*****************************************************************************
92 * IDirectMusicLoader8Impl implementation structure
94 struct IDirectMusicLoader8Impl
97 ICOM_VFIELD(IDirectMusicLoader8);
100 /* IDirectMusicLoaderImpl fields */
101 WCHAR wzSearchPath[MAX_PATH];
104 LPDMUS_PRIVATE_CACHE_ENTRY pCache; /* cache entries */
105 DWORD dwCacheSize; /* nr. of entries */
109 extern HRESULT WINAPI IDirectMusicLoader8Impl_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj);
110 extern ULONG WINAPI IDirectMusicLoader8Impl_AddRef (LPDIRECTMUSICLOADER8 iface);
111 extern ULONG WINAPI IDirectMusicLoader8Impl_Release (LPDIRECTMUSICLOADER8 iface);
112 /* IDirectMusicLoader: */
113 extern HRESULT WINAPI IDirectMusicLoader8Impl_GetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID*ppv);
114 extern HRESULT WINAPI IDirectMusicLoader8Impl_SetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc);
115 extern HRESULT WINAPI IDirectMusicLoader8Impl_SetSearchDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear);
116 extern HRESULT WINAPI IDirectMusicLoader8Impl_ScanDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName);
117 extern HRESULT WINAPI IDirectMusicLoader8Impl_CacheObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject);
118 extern HRESULT WINAPI IDirectMusicLoader8Impl_ReleaseObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject);
119 extern HRESULT WINAPI IDirectMusicLoader8Impl_ClearCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass);
120 extern HRESULT WINAPI IDirectMusicLoader8Impl_EnableCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, BOOL fEnable);
121 extern HRESULT WINAPI IDirectMusicLoader8Impl_EnumObject (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc);
122 /* IDirectMusicLoader8: */
123 extern void WINAPI IDirectMusicLoader8Impl_CollectGarbage (LPDIRECTMUSICLOADER8 iface);
124 extern HRESULT WINAPI IDirectMusicLoader8Impl_ReleaseObjectByUnknown (LPDIRECTMUSICLOADER8 iface, IUnknown* pObject);
125 extern HRESULT WINAPI IDirectMusicLoader8Impl_LoadObjectFromFile (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClassID, REFIID iidInterfaceID, WCHAR* pwzFilePath, void** ppObject);
127 /*****************************************************************************
128 * IDirectMusicContainerImpl implementation structure
130 struct IDirectMusicContainerImpl
132 /* IUnknown fields */
133 ICOM_VFIELD(IDirectMusicContainer);
136 /* IDirectMusicContainerImpl fields */
137 IDirectMusicContainerObject* pObject;
141 extern HRESULT WINAPI IDirectMusicContainerImpl_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj);
142 extern ULONG WINAPI IDirectMusicContainerImpl_AddRef (LPDIRECTMUSICCONTAINER iface);
143 extern ULONG WINAPI IDirectMusicContainerImpl_Release (LPDIRECTMUSICCONTAINER iface);
144 /* IDirectMusicContainer: */
145 extern HRESULT WINAPI IDirectMusicContainerImpl_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias);
148 /*****************************************************************************
149 * IDirectMusicContainerObject implementation structure
151 struct IDirectMusicContainerObject
153 /* IUnknown fields */
154 ICOM_VFIELD(IDirectMusicObject);
157 /* IDirectMusicObjectImpl fields */
158 LPDMUS_OBJECTDESC pDesc;
159 IDirectMusicContainerObjectStream* pStream;
160 IDirectMusicContainerImpl* pContainer;
164 extern HRESULT WINAPI IDirectMusicContainerObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
165 extern ULONG WINAPI IDirectMusicContainerObject_AddRef (LPDIRECTMUSICOBJECT iface);
166 extern ULONG WINAPI IDirectMusicContainerObject_Release (LPDIRECTMUSICOBJECT iface);
167 /* IDirectMusicObject: */
168 extern HRESULT WINAPI IDirectMusicContainerObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
169 extern HRESULT WINAPI IDirectMusicContainerObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
170 extern HRESULT WINAPI IDirectMusicContainerObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
172 /*****************************************************************************
173 * IDirectMusicContainerObjectStream implementation structure
175 struct IDirectMusicContainerObjectStream
177 /* IUnknown fields */
178 ICOM_VFIELD (IPersistStream);
181 /* IPersistStreamImpl fields */
182 IDirectMusicContainerObject* pParentObject;
186 extern HRESULT WINAPI IDirectMusicContainerObjectStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
187 extern ULONG WINAPI IDirectMusicContainerObjectStream_AddRef (LPPERSISTSTREAM iface);
188 extern ULONG WINAPI IDirectMusicContainerObjectStream_Release (LPPERSISTSTREAM iface);
190 extern HRESULT WINAPI IDirectMusicContainerObjectStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
191 /* IPersistStream: */
192 extern HRESULT WINAPI IDirectMusicContainerObjectStream_IsDirty (LPPERSISTSTREAM iface);
193 extern HRESULT WINAPI IDirectMusicContainerObjectStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
194 extern HRESULT WINAPI IDirectMusicContainerObjectStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
195 extern HRESULT WINAPI IDirectMusicContainerObjectStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
198 /*****************************************************************************
199 * ILoaderStream implementation structure
203 /* IUnknown fields */
204 ICOM_VTABLE(IStream) *StreamVtbl;
205 ICOM_VTABLE(IDirectMusicGetLoader) *GetLoaderVtbl;
208 /* ILoaderStream fields */
209 IDirectMusicLoader8Impl* pLoader;
211 WCHAR wzFileName[MAX_PATH]; /* for clone */
215 extern HRESULT WINAPI ILoaderStream_Attach (ILoaderStream* iface, LPCWSTR wzFile, IDirectMusicLoader *pLoader);
216 extern void WINAPI ILoaderStream_Detach (ILoaderStream* iface);
217 /* IDirectMusicGetLoader: */
218 extern HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj);
219 extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface);
220 extern ULONG WINAPI ILoaderStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface);
221 extern HRESULT WINAPI ILoaderStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader);
223 extern HRESULT WINAPI ILoaderStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj);
224 extern ULONG WINAPI ILoaderStream_IStream_AddRef (LPSTREAM iface);
225 extern ULONG WINAPI ILoaderStream_IStream_Release (LPSTREAM iface);extern HRESULT WINAPI ILoaderStream_IStream_Read (IStream* iface, void* pv, ULONG cb, ULONG* pcbRead);
226 extern HRESULT WINAPI ILoaderStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten);
227 extern HRESULT WINAPI ILoaderStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition);
228 extern HRESULT WINAPI ILoaderStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize);
229 extern HRESULT WINAPI ILoaderStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten);
230 extern HRESULT WINAPI ILoaderStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags);
231 extern HRESULT WINAPI ILoaderStream_IStream_Revert (LPSTREAM iface);
232 extern HRESULT WINAPI ILoaderStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
233 extern HRESULT WINAPI ILoaderStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
234 extern HRESULT WINAPI ILoaderStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag);
235 extern HRESULT WINAPI ILoaderStream_IStream_Clone (LPSTREAM iface, IStream** ppstm);
237 #endif /* __WINE_DMLOADER_PRIVATE_H */