Use the more idiomatic form of iterating through the list.
[wine] / dlls / dmloader / dmloader_private.h
CommitLineData
473c5657
RM
1/* DirectMusicLoader Private Include
2 *
0382ea1d 3 * Copyright (C) 2003-2004 Rok Mandeljc
473c5657
RM
4 *
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.
9 *
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.
14 *
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.
18 */
19
20#ifndef __WINE_DMLOADER_PRIVATE_H
21#define __WINE_DMLOADER_PRIVATE_H
22
b26d65bb 23#include <stdio.h>
e37c6e18 24#include <stdarg.h>
b26d65bb 25#include <string.h>
e37c6e18 26
bf72af30
FG
27#define COBJMACROS
28
473c5657 29#include "windef.h"
473c5657
RM
30#include "winbase.h"
31#include "winnt.h"
e37c6e18 32#include "wingdi.h"
0382ea1d
RM
33#include "winuser.h"
34
35#include "wine/debug.h"
1d0585c4 36#include "wine/list.h"
0382ea1d
RM
37#include "wine/unicode.h"
38#include "winreg.h"
25e2a320 39#include "objbase.h"
473c5657 40
0382ea1d
RM
41#include "dmusici.h"
42#include "dmusicf.h"
43#include "dmusics.h"
df167d17 44
936198ce
AJ
45#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
46
72c80375
RM
47/* dmloader.dll global (for DllCanUnloadNow) */
48extern DWORD dwDirectMusicLoader; /* number of DirectMusicLoader(CF) instances */
49extern DWORD dwDirectMusicContainer; /* number of DirectMusicContainer(CF) instances */
df167d17 50
473c5657
RM
51/*****************************************************************************
52 * Interfaces
53 */
72c80375
RM
54typedef struct IDirectMusicLoaderCF IDirectMusicLoaderCF;
55typedef struct IDirectMusicContainerCF IDirectMusicContainerCF;
df167d17 56
72c80375
RM
57typedef struct IDirectMusicLoaderImpl IDirectMusicLoaderImpl;
58typedef struct IDirectMusicContainerImpl IDirectMusicContainerImpl;
59
60typedef struct IDirectMusicLoaderFileStream IDirectMusicLoaderFileStream;
61typedef struct IDirectMusicLoaderResourceStream IDirectMusicLoaderResourceStream;
62typedef struct IDirectMusicLoaderGenericStream IDirectMusicLoaderGenericStream;
63
473c5657
RM
64
65/*****************************************************************************
66 * Predeclare the interface implementation structures
67 */
48c4bb3c
AJ
68extern IClassFactoryVtbl DirectMusicLoaderCF_Vtbl;
69extern IClassFactoryVtbl DirectMusicContainerCF_Vtbl;
72c80375 70
48c4bb3c 71extern IDirectMusicLoader8Vtbl DirectMusicLoader_Loader_Vtbl;
df167d17 72
48c4bb3c
AJ
73extern IDirectMusicContainerVtbl DirectMusicContainer_Container_Vtbl;
74extern IDirectMusicObjectVtbl DirectMusicContainer_Object_Vtbl;
75extern IPersistStreamVtbl DirectMusicContainer_PersistStream_Vtbl;
72c80375 76
48c4bb3c
AJ
77extern IStreamVtbl DirectMusicLoaderFileStream_Stream_Vtbl;
78extern IDirectMusicGetLoaderVtbl DirectMusicLoaderFileStream_GetLoader_Vtbl;
72c80375 79
48c4bb3c
AJ
80extern IStreamVtbl DirectMusicLoaderResourceStream_Stream_Vtbl;
81extern IDirectMusicGetLoaderVtbl DirectMusicLoaderResourceStream_GetLoader_Vtbl;
df167d17 82
48c4bb3c
AJ
83extern IStreamVtbl DirectMusicLoaderGenericStream_Stream_Vtbl;
84extern IDirectMusicGetLoaderVtbl DirectMusicLoaderGenericStream_GetLoader_Vtbl;
473c5657
RM
85
86/*****************************************************************************
72c80375 87 * Creation helpers
473c5657 88 */
72c80375
RM
89extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderCF (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter);
90extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerCF (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter);
91
0382ea1d 92extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter);
72c80375 93extern HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderImpl (LPDIRECTMUSICLOADER8 iface);
0382ea1d 94extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter);
72c80375
RM
95extern HRESULT WINAPI DMUSIC_DestroyDirectMusicContainerImpl(LPDIRECTMUSICCONTAINER iface);
96
97extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderFileStream (LPVOID *ppobj);
98extern HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderFileStream (LPSTREAM iface);
df167d17 99
72c80375
RM
100extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderResourceStream (LPVOID *ppobj);
101extern HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderResourceStream (LPSTREAM iface);
102
103extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderGenericStream (LPVOID *ppobj);
104extern HRESULT WINAPI DMUSIC_DestroyDirectMusicLoaderGenericStream (LPSTREAM iface);
473c5657
RM
105
106/*****************************************************************************
72c80375 107 * IDirectMusicLoaderCF implementation structure
473c5657 108 */
72c80375
RM
109struct IDirectMusicLoaderCF {
110 /* IUnknown fields */
0467ce9f 111 IClassFactoryVtbl *lpVtbl;
72c80375
RM
112 DWORD dwRef;
113};
473c5657 114
72c80375
RM
115/* IUnknown / IClassFactory: */
116extern HRESULT WINAPI IDirectMusicLoaderCF_QueryInterface (LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj);
117extern ULONG WINAPI IDirectMusicLoaderCF_AddRef (LPCLASSFACTORY iface);
118extern ULONG WINAPI IDirectMusicLoaderCF_Release (LPCLASSFACTORY iface);
119extern HRESULT WINAPI IDirectMusicLoaderCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj);
120extern HRESULT WINAPI IDirectMusicLoaderCF_LockServer (LPCLASSFACTORY iface,BOOL dolock);
121
122
123/*****************************************************************************
124 * IDirectMusicContainerCF implementation structure
125 */
126struct IDirectMusicContainerCF {
127 /* IUnknown fields */
0467ce9f 128 IClassFactoryVtbl *lpVtbl;
72c80375
RM
129 DWORD dwRef;
130};
131
132/* IUnknown / IClassFactory: */
133extern HRESULT WINAPI IDirectMusicContainerCF_QueryInterface (LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj);
134extern ULONG WINAPI IDirectMusicContainerCF_AddRef (LPCLASSFACTORY iface);
135extern ULONG WINAPI IDirectMusicContainerCF_Release (LPCLASSFACTORY iface);
136extern HRESULT WINAPI IDirectMusicContainerCF_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj);
137extern HRESULT WINAPI IDirectMusicContainerCF_LockServer (LPCLASSFACTORY iface,BOOL dolock);
138
139
140/* cache/alias entry */
141typedef struct _WINE_LOADER_ENTRY {
142 struct list entry; /* for listing elements */
143 DMUS_OBJECTDESC Desc;
144 LPDIRECTMUSICOBJECT pObject; /* pointer to object */
145 BOOL bInvalidDefaultDLS; /* my workaround for enabling caching of "faulty" default dls collection */
146} WINE_LOADER_ENTRY, *LPWINE_LOADER_ENTRY;
147
148/* cache options, search paths for specific types of objects */
149typedef struct _WINE_LOADER_OPTION {
150 struct list entry; /* for listing elements */
151 GUID guidClass; /* ID of object type */
152 WCHAR wszSearchPath[MAX_PATH]; /* look for objects of certain type in here */
153 BOOL bCache; /* cache objects of certain type */
154} WINE_LOADER_OPTION, *LPWINE_LOADER_OPTION;
155
156/*****************************************************************************
157 * IDirectMusicLoaderImpl implementation structure
158 */
159struct IDirectMusicLoaderImpl {
160 /* VTABLEs */
48c4bb3c 161 IDirectMusicLoader8Vtbl *LoaderVtbl;
72c80375
RM
162 /* reference counter */
163 DWORD dwRef;
164 /* simple cache (linked list) */
165 struct list *pObjects;
166 /* settings for certain object classes */
167 struct list *pClassSettings;
168 /* critical section */
169 CRITICAL_SECTION CritSect;
473c5657
RM
170};
171
72c80375
RM
172/* IUnknown / IDirectMusicLoader(8): */
173extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_QueryInterface (LPDIRECTMUSICLOADER8 iface, REFIID riid, LPVOID *ppobj);
174extern ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_AddRef (LPDIRECTMUSICLOADER8 iface);
175extern ULONG WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_Release (LPDIRECTMUSICLOADER8 iface);
176extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_GetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc, REFIID riid, LPVOID*ppv);
177extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetObject (LPDIRECTMUSICLOADER8 iface, LPDMUS_OBJECTDESC pDesc);
178extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_SetSearchDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzPath, BOOL fClear);
179extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ScanDirectory (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, WCHAR* pwzFileExtension, WCHAR* pwzScanFileName);
180extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_CacheObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject);
181extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObject (LPDIRECTMUSICLOADER8 iface, IDirectMusicObject* pObject);
182extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ClearCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass);
183extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnableCache (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, BOOL fEnable);
184extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_EnumObject (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc);
185extern void WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_CollectGarbage (LPDIRECTMUSICLOADER8 iface);
186extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_ReleaseObjectByUnknown (LPDIRECTMUSICLOADER8 iface, IUnknown* pObject);
187extern HRESULT WINAPI IDirectMusicLoaderImpl_IDirectMusicLoader_LoadObjectFromFile (LPDIRECTMUSICLOADER8 iface, REFGUID rguidClassID, REFIID iidInterfaceID, WCHAR* pwzFilePath, void** ppObject);
188
189/* contained object entry */
190typedef struct _WINE_CONTAINER_ENTRY {
191 struct list entry; /* for listing elements */
192 DMUS_OBJECTDESC Desc;
193 BOOL bIsRIFF;
194 DWORD dwFlags; /* DMUS_CONTAINED_OBJF_KEEP: keep object in loader's cache, even when container is released */
195 WCHAR* wszAlias;
196 LPDIRECTMUSICOBJECT pObject; /* needed when releasing from loader's cache on container release */
197} WINE_CONTAINER_ENTRY, *LPWINE_CONTAINER_ENTRY;
473c5657
RM
198
199/*****************************************************************************
200 * IDirectMusicContainerImpl implementation structure
201 */
0382ea1d 202struct IDirectMusicContainerImpl {
72c80375 203 /* VTABLEs */
48c4bb3c
AJ
204 IDirectMusicContainerVtbl *ContainerVtbl;
205 IDirectMusicObjectVtbl *ObjectVtbl;
206 IPersistStreamVtbl *PersistStreamVtbl;
72c80375
RM
207 /* reference counter */
208 DWORD dwRef;
209 /* stream */
210 LPSTREAM pStream;
211 /* header */
212 DMUS_IO_CONTAINER_HEADER Header;
213 /* data */
214 struct list *pContainedObjects;
215 /* descriptor */
216 DMUS_OBJECTDESC Desc;
df167d17
RM
217};
218
72c80375 219/* IUnknown / IDirectMusicContainer: */
0382ea1d
RM
220extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_QueryInterface (LPDIRECTMUSICCONTAINER iface, REFIID riid, LPVOID *ppobj);
221extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_AddRef (LPDIRECTMUSICCONTAINER iface);
222extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_Release (LPDIRECTMUSICCONTAINER iface);
223extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicContainer_EnumObject (LPDIRECTMUSICCONTAINER iface, REFGUID rguidClass, DWORD dwIndex, LPDMUS_OBJECTDESC pDesc, WCHAR* pwszAlias);
df167d17 224/* IDirectMusicObject: */
0382ea1d
RM
225extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj);
226extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
227extern ULONG WINAPI IDirectMusicContainerImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface);
228extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
229extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc);
230extern HRESULT WINAPI IDirectMusicContainerImpl_IDirectMusicObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface, LPSTREAM pStream, LPDMUS_OBJECTDESC pDesc);
df167d17 231/* IPersistStream: */
0382ea1d
RM
232extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, void** ppvObject);
233extern ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
234extern ULONG WINAPI IDirectMusicContainerImpl_IPersistStream_Release (LPPERSISTSTREAM iface);
235extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID);
236extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface);
237extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm);
238extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty);
239extern HRESULT WINAPI IDirectMusicContainerImpl_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize);
df167d17
RM
240
241
242/*****************************************************************************
72c80375 243 * IDirectMusicLoaderFileStream implementation structure
df167d17 244 */
72c80375
RM
245struct IDirectMusicLoaderFileStream {
246 /* VTABLEs */
48c4bb3c
AJ
247 IStreamVtbl *StreamVtbl;
248 IDirectMusicGetLoaderVtbl *GetLoaderVtbl;
72c80375
RM
249 /* reference counter */
250 DWORD dwRef;
251 /* file */
252 WCHAR wzFileName[MAX_PATH]; /* for clone */
253 HANDLE hFile;
254 /* loader */
255 LPDIRECTMUSICLOADER8 pLoader;
df167d17
RM
256};
257
258/* Custom: */
72c80375
RM
259extern HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFile, LPDIRECTMUSICLOADER pLoader);
260extern void WINAPI IDirectMusicLoaderFileStream_Detach (LPSTREAM iface);
261/* IUnknown/IStream: */
262extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj);
263extern ULONG WINAPI IDirectMusicLoaderFileStream_IStream_AddRef (LPSTREAM iface);
264extern ULONG WINAPI IDirectMusicLoaderFileStream_IStream_Release (LPSTREAM iface);
265extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Read (IStream* iface, void* pv, ULONG cb, ULONG* pcbRead);
266extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten);
267extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition);
268extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize);
269extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten);
270extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags);
271extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Revert (LPSTREAM iface);
272extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
273extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
274extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag);
275extern HRESULT WINAPI IDirectMusicLoaderFileStream_IStream_Clone (LPSTREAM iface, IStream** ppstm);
473c5657 276/* IDirectMusicGetLoader: */
72c80375
RM
277extern HRESULT WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj);
278extern ULONG WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface);
279extern ULONG WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface);
280extern HRESULT WINAPI IDirectMusicLoaderFileStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader);
281
282
283/*****************************************************************************
284 * IDirectMusicLoaderResourceStream implementation structure
285 */
286struct IDirectMusicLoaderResourceStream {
287 /* IUnknown fields */
48c4bb3c
AJ
288 IStreamVtbl *StreamVtbl;
289 IDirectMusicGetLoaderVtbl *GetLoaderVtbl;
72c80375
RM
290 /* reference counter */
291 DWORD dwRef;
292 /* data */
293 LPBYTE pbMemData;
294 LONGLONG llMemLength;
295 /* current position */
296 LONGLONG llPos;
297 /* loader */
298 LPDIRECTMUSICLOADER8 pLoader;
299};
300
301/* Custom: */
302extern HRESULT WINAPI IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface, LPBYTE pbMemData, LONGLONG llMemLength, LONGLONG llPos, LPDIRECTMUSICLOADER pLoader);
303extern void WINAPI IDirectMusicLoaderResourceStream_Detach (LPSTREAM iface);
304/* IUnknown/IStream: */
305extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj);
306extern ULONG WINAPI IDirectMusicLoaderResourceStream_IStream_AddRef (LPSTREAM iface);
307extern ULONG WINAPI IDirectMusicLoaderResourceStream_IStream_Release (LPSTREAM iface);
308extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Read (IStream* iface, void* pv, ULONG cb, ULONG* pcbRead);
309extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten);
310extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition);
311extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize);
312extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten);
313extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags);
314extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Revert (LPSTREAM iface);
315extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
316extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
317extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag);
318extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IStream_Clone (LPSTREAM iface, IStream** ppstm);
319/* IDirectMusicGetLoader: */
320extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj);
321extern ULONG WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface);
322extern ULONG WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface);
323extern HRESULT WINAPI IDirectMusicLoaderResourceStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader);
324
325
326/*****************************************************************************
327 * IDirectMusicLoaderGenericStream implementation structure
328 */
329struct IDirectMusicLoaderGenericStream {
330 /* IUnknown fields */
48c4bb3c
AJ
331 IStreamVtbl *StreamVtbl;
332 IDirectMusicGetLoaderVtbl *GetLoaderVtbl;
72c80375
RM
333 /* reference counter */
334 DWORD dwRef;
335 /* stream */
336 LPSTREAM pStream;
337 /* loader */
338 LPDIRECTMUSICLOADER8 pLoader;
339};
340
341/* Custom: */
342extern HRESULT WINAPI IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface, LPSTREAM pStream, LPDIRECTMUSICLOADER pLoader);
343extern void WINAPI IDirectMusicLoaderGenericStream_Detach (LPSTREAM iface);
344/* IUnknown/IStream: */
345extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_QueryInterface (LPSTREAM iface, REFIID riid, void** ppobj);
346extern ULONG WINAPI IDirectMusicLoaderGenericStream_IStream_AddRef (LPSTREAM iface);
347extern ULONG WINAPI IDirectMusicLoaderGenericStream_IStream_Release (LPSTREAM iface);
348extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Read (IStream* iface, void* pv, ULONG cb, ULONG* pcbRead);
349extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Write (LPSTREAM iface, const void* pv, ULONG cb, ULONG* pcbWritten);
350extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Seek (LPSTREAM iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition);
351extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_SetSize (LPSTREAM iface, ULARGE_INTEGER libNewSize);
352extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_CopyTo (LPSTREAM iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten);
353extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Commit (LPSTREAM iface, DWORD grfCommitFlags);
354extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Revert (LPSTREAM iface);
355extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_LockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
356extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_UnlockRegion (LPSTREAM iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
357extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Stat (LPSTREAM iface, STATSTG* pstatstg, DWORD grfStatFlag);
358extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IStream_Clone (LPSTREAM iface, IStream** ppstm);
359/* IDirectMusicGetLoader: */
360extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface, REFIID riid, void** ppobj);
361extern ULONG WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface);
362extern ULONG WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface);
363extern HRESULT WINAPI IDirectMusicLoaderGenericStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface, IDirectMusicLoader **ppLoader);
473c5657 364
0382ea1d
RM
365
366/*****************************************************************************
367 * Misc.
368 */
369/* for simpler reading */
72c80375 370typedef struct _WINE_CHUNK {
0382ea1d
RM
371 FOURCC fccID; /* FOURCC ID of the chunk */
372 DWORD dwSize; /* size of the chunk */
72c80375
RM
373} WINE_CHUNK, *LPWINE_CHUNK;
374
375extern HRESULT WINAPI DMUSIC_GetDefaultGMPath (WCHAR wszPath[MAX_PATH]);
376extern HRESULT WINAPI DMUSIC_GetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache);
377extern HRESULT WINAPI DMUSIC_SetLoaderSettings (LPDIRECTMUSICLOADER8 iface, REFGUID pClassID, WCHAR* wszSearchPath, LPBOOL pbCache);
378extern HRESULT WINAPI DMUSIC_InitLoaderSettings (LPDIRECTMUSICLOADER8 iface);
379extern HRESULT WINAPI DMUSIC_CopyDescriptor (LPDMUS_OBJECTDESC pDst, LPDMUS_OBJECTDESC pSrc);
380extern BOOL WINAPI DMUSIC_IsValidLoadableClass (REFCLSID pClassID);
381
382#include "debug.h"
0382ea1d 383
473c5657 384#endif /* __WINE_DMLOADER_PRIVATE_H */