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
26 #include "wine/debug.h"
36 #include "wine/list.h"
39 /*****************************************************************************
40 * Auxiliary definitions
42 typedef struct _DMUS_PRIVATE_CACHE_ENTRY
{
43 struct list entry
; /* for listing elements */
45 WCHAR wzFileName
[MAX_PATH
];
47 IDirectMusicObject
* pObject
;
48 } DMUS_PRIVATE_CACHE_ENTRY
, *LPDMUS_PRIVATE_CACHE_ENTRY
;
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
];
103 /* simple cache (linked list) */
104 struct list CacheList
;
108 extern HRESULT WINAPI
IDirectMusicLoader8Impl_QueryInterface (LPDIRECTMUSICLOADER8 iface
, REFIID riid
, LPVOID
*ppobj
);
109 extern ULONG WINAPI
IDirectMusicLoader8Impl_AddRef (LPDIRECTMUSICLOADER8 iface
);
110 extern ULONG WINAPI
IDirectMusicLoader8Impl_Release (LPDIRECTMUSICLOADER8 iface
);
111 /* IDirectMusicLoader: */
112 extern HRESULT WINAPI
IDirectMusicLoader8Impl_GetObject (LPDIRECTMUSICLOADER8 iface
, LPDMUS_OBJECTDESC pDesc
, REFIID riid
, LPVOID
*ppv
);
113 extern HRESULT WINAPI
IDirectMusicLoader8Impl_SetObject (LPDIRECTMUSICLOADER8 iface
, LPDMUS_OBJECTDESC pDesc
);
114 extern HRESULT WINAPI
IDirectMusicLoader8Impl_SetSearchDirectory (LPDIRECTMUSICLOADER8 iface
, REFGUID rguidClass
, WCHAR
* pwzPath
, BOOL fClear
);
115 extern HRESULT WINAPI
IDirectMusicLoader8Impl_ScanDirectory (LPDIRECTMUSICLOADER8 iface
, REFGUID rguidClass
, WCHAR
* pwzFileExtension
, WCHAR
* pwzScanFileName
);
116 extern HRESULT WINAPI
IDirectMusicLoader8Impl_CacheObject (LPDIRECTMUSICLOADER8 iface
, IDirectMusicObject
* pObject
);
117 extern HRESULT WINAPI
IDirectMusicLoader8Impl_ReleaseObject (LPDIRECTMUSICLOADER8 iface
, IDirectMusicObject
* pObject
);
118 extern HRESULT WINAPI
IDirectMusicLoader8Impl_ClearCache (LPDIRECTMUSICLOADER8 iface
, REFGUID rguidClass
);
119 extern HRESULT WINAPI
IDirectMusicLoader8Impl_EnableCache (LPDIRECTMUSICLOADER8 iface
, REFGUID rguidClass
, BOOL fEnable
);
120 extern HRESULT WINAPI
IDirectMusicLoader8Impl_EnumObject (LPDIRECTMUSICLOADER8 iface
, REFGUID rguidClass
, DWORD dwIndex
, LPDMUS_OBJECTDESC pDesc
);
121 /* IDirectMusicLoader8: */
122 extern void WINAPI
IDirectMusicLoader8Impl_CollectGarbage (LPDIRECTMUSICLOADER8 iface
);
123 extern HRESULT WINAPI
IDirectMusicLoader8Impl_ReleaseObjectByUnknown (LPDIRECTMUSICLOADER8 iface
, IUnknown
* pObject
);
124 extern HRESULT WINAPI
IDirectMusicLoader8Impl_LoadObjectFromFile (LPDIRECTMUSICLOADER8 iface
, REFGUID rguidClassID
, REFIID iidInterfaceID
, WCHAR
* pwzFilePath
, void** ppObject
);
126 /*****************************************************************************
127 * IDirectMusicContainerImpl implementation structure
129 struct IDirectMusicContainerImpl
131 /* IUnknown fields */
132 ICOM_VFIELD(IDirectMusicContainer
);
135 /* IDirectMusicContainerImpl fields */
136 IDirectMusicContainerObject
* pObject
;
140 extern HRESULT WINAPI
IDirectMusicContainerImpl_QueryInterface (LPDIRECTMUSICCONTAINER iface
, REFIID riid
, LPVOID
*ppobj
);
141 extern ULONG WINAPI
IDirectMusicContainerImpl_AddRef (LPDIRECTMUSICCONTAINER iface
);
142 extern ULONG WINAPI
IDirectMusicContainerImpl_Release (LPDIRECTMUSICCONTAINER iface
);
143 /* IDirectMusicContainer: */
144 extern HRESULT WINAPI
IDirectMusicContainerImpl_EnumObject (LPDIRECTMUSICCONTAINER iface
, REFGUID rguidClass
, DWORD dwIndex
, LPDMUS_OBJECTDESC pDesc
, WCHAR
* pwszAlias
);
147 /*****************************************************************************
148 * IDirectMusicContainerObject implementation structure
150 struct IDirectMusicContainerObject
152 /* IUnknown fields */
153 ICOM_VFIELD(IDirectMusicObject
);
156 /* IDirectMusicObjectImpl fields */
157 LPDMUS_OBJECTDESC pDesc
;
158 IDirectMusicContainerObjectStream
* pStream
;
159 IDirectMusicContainerImpl
* pContainer
;
163 extern HRESULT WINAPI
IDirectMusicContainerObject_QueryInterface (LPDIRECTMUSICOBJECT iface
, REFIID riid
, LPVOID
*ppobj
);
164 extern ULONG WINAPI
IDirectMusicContainerObject_AddRef (LPDIRECTMUSICOBJECT iface
);
165 extern ULONG WINAPI
IDirectMusicContainerObject_Release (LPDIRECTMUSICOBJECT iface
);
166 /* IDirectMusicObject: */
167 extern HRESULT WINAPI
IDirectMusicContainerObject_GetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
);
168 extern HRESULT WINAPI
IDirectMusicContainerObject_SetDescriptor (LPDIRECTMUSICOBJECT iface
, LPDMUS_OBJECTDESC pDesc
);
169 extern HRESULT WINAPI
IDirectMusicContainerObject_ParseDescriptor (LPDIRECTMUSICOBJECT iface
, LPSTREAM pStream
, LPDMUS_OBJECTDESC pDesc
);
171 /*****************************************************************************
172 * IDirectMusicContainerObjectStream implementation structure
174 struct IDirectMusicContainerObjectStream
176 /* IUnknown fields */
177 ICOM_VFIELD (IPersistStream
);
180 /* IPersistStreamImpl fields */
181 IDirectMusicContainerObject
* pParentObject
;
185 extern HRESULT WINAPI
IDirectMusicContainerObjectStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, void** ppvObject
);
186 extern ULONG WINAPI
IDirectMusicContainerObjectStream_AddRef (LPPERSISTSTREAM iface
);
187 extern ULONG WINAPI
IDirectMusicContainerObjectStream_Release (LPPERSISTSTREAM iface
);
189 extern HRESULT WINAPI
IDirectMusicContainerObjectStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
);
190 /* IPersistStream: */
191 extern HRESULT WINAPI
IDirectMusicContainerObjectStream_IsDirty (LPPERSISTSTREAM iface
);
192 extern HRESULT WINAPI
IDirectMusicContainerObjectStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
);
193 extern HRESULT WINAPI
IDirectMusicContainerObjectStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
);
194 extern HRESULT WINAPI
IDirectMusicContainerObjectStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
);
197 /*****************************************************************************
198 * ILoaderStream implementation structure
202 /* IUnknown fields */
203 ICOM_VTABLE(IStream
) *StreamVtbl
;
204 ICOM_VTABLE(IDirectMusicGetLoader
) *GetLoaderVtbl
;
207 /* ILoaderStream fields */
208 IDirectMusicLoader8Impl
* pLoader
;
210 WCHAR wzFileName
[MAX_PATH
]; /* for clone */
214 extern HRESULT WINAPI
ILoaderStream_Attach (ILoaderStream
* iface
, LPCWSTR wzFile
, IDirectMusicLoader
*pLoader
);
215 extern void WINAPI
ILoaderStream_Detach (ILoaderStream
* iface
);
216 /* IDirectMusicGetLoader: */
217 extern HRESULT WINAPI
ILoaderStream_IDirectMusicGetLoader_QueryInterface (LPDIRECTMUSICGETLOADER iface
, REFIID riid
, void** ppobj
);
218 extern ULONG WINAPI
ILoaderStream_IDirectMusicGetLoader_AddRef (LPDIRECTMUSICGETLOADER iface
);
219 extern ULONG WINAPI
ILoaderStream_IDirectMusicGetLoader_Release (LPDIRECTMUSICGETLOADER iface
);
220 extern HRESULT WINAPI
ILoaderStream_IDirectMusicGetLoader_GetLoader (LPDIRECTMUSICGETLOADER iface
, IDirectMusicLoader
**ppLoader
);
222 extern HRESULT WINAPI
ILoaderStream_IStream_QueryInterface (LPSTREAM iface
, REFIID riid
, void** ppobj
);
223 extern ULONG WINAPI
ILoaderStream_IStream_AddRef (LPSTREAM iface
);
224 extern ULONG WINAPI
ILoaderStream_IStream_Release (LPSTREAM iface
);extern HRESULT WINAPI
ILoaderStream_IStream_Read (IStream
* iface
, void* pv
, ULONG cb
, ULONG
* pcbRead
);
225 extern HRESULT WINAPI
ILoaderStream_IStream_Write (LPSTREAM iface
, const void* pv
, ULONG cb
, ULONG
* pcbWritten
);
226 extern HRESULT WINAPI
ILoaderStream_IStream_Seek (LPSTREAM iface
, LARGE_INTEGER dlibMove
, DWORD dwOrigin
, ULARGE_INTEGER
* plibNewPosition
);
227 extern HRESULT WINAPI
ILoaderStream_IStream_SetSize (LPSTREAM iface
, ULARGE_INTEGER libNewSize
);
228 extern HRESULT WINAPI
ILoaderStream_IStream_CopyTo (LPSTREAM iface
, IStream
* pstm
, ULARGE_INTEGER cb
, ULARGE_INTEGER
* pcbRead
, ULARGE_INTEGER
* pcbWritten
);
229 extern HRESULT WINAPI
ILoaderStream_IStream_Commit (LPSTREAM iface
, DWORD grfCommitFlags
);
230 extern HRESULT WINAPI
ILoaderStream_IStream_Revert (LPSTREAM iface
);
231 extern HRESULT WINAPI
ILoaderStream_IStream_LockRegion (LPSTREAM iface
, ULARGE_INTEGER libOffset
, ULARGE_INTEGER cb
, DWORD dwLockType
);
232 extern HRESULT WINAPI
ILoaderStream_IStream_UnlockRegion (LPSTREAM iface
, ULARGE_INTEGER libOffset
, ULARGE_INTEGER cb
, DWORD dwLockType
);
233 extern HRESULT WINAPI
ILoaderStream_IStream_Stat (LPSTREAM iface
, STATSTG
* pstatstg
, DWORD grfStatFlag
);
234 extern HRESULT WINAPI
ILoaderStream_IStream_Clone (LPSTREAM iface
, IStream
** ppstm
);
236 #endif /* __WINE_DMLOADER_PRIVATE_H */