1 /* DirectMusicLoader Private Include
3 * Copyright (C) 2003-2004 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __WINE_DMLOADER_PRIVATE_H
21 #define __WINE_DMLOADER_PRIVATE_H
35 #include "wine/debug.h"
36 #include "wine/list.h"
37 #include "wine/unicode.h"
45 #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
46 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
48 /* dmloader.dll global (for DllCanUnloadNow) */
49 extern LONG module_ref DECLSPEC_HIDDEN
;
50 static inline void lock_module(void) { InterlockedIncrement( &module_ref
); }
51 static inline void unlock_module(void) { InterlockedDecrement( &module_ref
); }
53 /*****************************************************************************
56 typedef struct IDirectMusicLoaderCF IDirectMusicLoaderCF
;
57 typedef struct IDirectMusicContainerCF IDirectMusicContainerCF
;
59 typedef struct IDirectMusicLoaderFileStream IDirectMusicLoaderFileStream
;
60 typedef struct IDirectMusicLoaderResourceStream IDirectMusicLoaderResourceStream
;
61 typedef struct IDirectMusicLoaderGenericStream IDirectMusicLoaderGenericStream
;
63 /*****************************************************************************
66 extern HRESULT WINAPI
create_dmloader(REFIID riid
, void **ret_iface
) DECLSPEC_HIDDEN
;
67 extern HRESULT WINAPI
create_dmcontainer(REFIID riid
, void **ret_iface
) DECLSPEC_HIDDEN
;
68 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicLoaderFileStream (LPVOID
*ppobj
) DECLSPEC_HIDDEN
;
69 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicLoaderResourceStream (LPVOID
*ppobj
) DECLSPEC_HIDDEN
;
70 extern HRESULT WINAPI
DMUSIC_CreateDirectMusicLoaderGenericStream (LPVOID
*ppobj
) DECLSPEC_HIDDEN
;
72 /*****************************************************************************
73 * IDirectMusicLoaderFileStream implementation structure
75 struct IDirectMusicLoaderFileStream
{
77 const IStreamVtbl
*StreamVtbl
;
78 const IDirectMusicGetLoaderVtbl
*GetLoaderVtbl
;
79 /* reference counter */
82 WCHAR wzFileName
[MAX_PATH
]; /* for clone */
85 LPDIRECTMUSICLOADER8 pLoader
;
89 extern HRESULT WINAPI
IDirectMusicLoaderFileStream_Attach (LPSTREAM iface
, LPCWSTR wzFile
, LPDIRECTMUSICLOADER8 pLoader
) DECLSPEC_HIDDEN
;
91 /*****************************************************************************
92 * IDirectMusicLoaderResourceStream implementation structure
94 struct IDirectMusicLoaderResourceStream
{
96 const IStreamVtbl
*StreamVtbl
;
97 const IDirectMusicGetLoaderVtbl
*GetLoaderVtbl
;
98 /* reference counter */
102 LONGLONG llMemLength
;
103 /* current position */
106 LPDIRECTMUSICLOADER8 pLoader
;
110 extern HRESULT WINAPI
IDirectMusicLoaderResourceStream_Attach (LPSTREAM iface
, LPBYTE pbMemData
, LONGLONG llMemLength
, LONGLONG llPos
, LPDIRECTMUSICLOADER8 pLoader
) DECLSPEC_HIDDEN
;
112 /*****************************************************************************
113 * IDirectMusicLoaderGenericStream implementation structure
115 struct IDirectMusicLoaderGenericStream
{
116 /* IUnknown fields */
117 const IStreamVtbl
*StreamVtbl
;
118 const IDirectMusicGetLoaderVtbl
*GetLoaderVtbl
;
119 /* reference counter */
124 LPDIRECTMUSICLOADER8 pLoader
;
128 extern HRESULT WINAPI
IDirectMusicLoaderGenericStream_Attach (LPSTREAM iface
, LPSTREAM pStream
, LPDIRECTMUSICLOADER8 pLoader
) DECLSPEC_HIDDEN
;
132 #endif /* __WINE_DMLOADER_PRIVATE_H */