ntdll: Add a stubbed NtSetSystemInformation.
[wine] / dlls / dmscript / dmscript_private.h
1 /* DirectMusicScript Private Include
2  *
3  * Copyright (C) 2003-2004 Rok Mandeljc
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_DMSCRIPT_PRIVATE_H
21 #define __WINE_DMSCRIPT_PRIVATE_H
22
23 #include <stdio.h>
24 #include <stdarg.h>
25 #include <string.h>
26
27 #define COBJMACROS
28
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winnt.h"
32 #include "wingdi.h"
33 #include "winuser.h"
34
35 #include "wine/debug.h"
36 #include "wine/list.h"
37 #include "wine/unicode.h"
38 #include "winreg.h"
39 #include "objbase.h"
40
41 #include "dmusici.h"
42 #include "dmusicf.h"
43 #include "dmusics.h"
44
45 /*****************************************************************************
46  * Interfaces
47  */
48 typedef struct IDirectMusicScriptImpl IDirectMusicScriptImpl;
49
50 typedef struct IDirectMusicScriptTrack IDirectMusicScriptTrack;
51
52 /*****************************************************************************
53  * ClassFactory
54  */
55 extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
56
57 extern HRESULT WINAPI DMUSIC_CreateDirectMusicScriptTrack (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter);
58
59 /*****************************************************************************
60  * IDirectMusicScriptImpl implementation structure
61  */
62 struct IDirectMusicScriptImpl {
63   /* IUnknown fields */
64   const IUnknownVtbl *UnknownVtbl;
65   const IDirectMusicScriptVtbl *ScriptVtbl;
66   const IDirectMusicObjectVtbl *ObjectVtbl;
67   const IPersistStreamVtbl *PersistStreamVtbl;
68   LONG           ref;
69
70   /* IDirectMusicScriptImpl fields */
71   IDirectMusicPerformance* pPerformance;
72   LPDMUS_OBJECTDESC pDesc;
73   DMUS_IO_SCRIPT_HEADER* pHeader;
74   DMUS_IO_VERSION* pVersion;
75   WCHAR* pwzLanguage;
76   WCHAR* pwzSource;
77 };
78
79 /* IUnknown: */
80 extern HRESULT WINAPI IDirectMusicScriptImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
81 extern ULONG WINAPI   IDirectMusicScriptImpl_IUnknown_AddRef (LPUNKNOWN iface);
82 /* IDirectMusicScript: */
83 extern ULONG WINAPI   IDirectMusicScriptImpl_IDirectMusicScript_AddRef (LPDIRECTMUSICSCRIPT iface);
84 /* IDirectMusicObject: */
85 extern ULONG WINAPI   IDirectMusicScriptImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface);
86 /* IPersistStream: */
87 extern ULONG WINAPI   IDirectMusicScriptImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface);
88
89 /*****************************************************************************
90  * IDirectMusicScriptTrack implementation structure
91  */
92 struct IDirectMusicScriptTrack {
93   /* IUnknown fields */
94   const IUnknownVtbl *UnknownVtbl;
95   const IDirectMusicTrack8Vtbl *TrackVtbl;
96   const IPersistStreamVtbl *PersistStreamVtbl;
97   LONG           ref;
98
99   /* IDirectMusicScriptTrack fields */
100   LPDMUS_OBJECTDESC pDesc;
101 };
102
103 /* IUnknown: */
104 extern HRESULT WINAPI IDirectMusicScriptTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj);
105 extern ULONG WINAPI   IDirectMusicScriptTrack_IUnknown_AddRef (LPUNKNOWN iface);
106 /* IDirectMusicTrack(8): */
107 extern ULONG WINAPI   IDirectMusicScriptTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
108 /* IPersistStream: */
109 extern ULONG WINAPI   IDirectMusicScriptTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
110
111 /**********************************************************************
112  * Dll lifetime tracking declaration for dmscript.dll
113  */
114 extern LONG DMSCRIPT_refCount;
115 static inline void DMSCRIPT_LockModule(void) { InterlockedIncrement( &DMSCRIPT_refCount ); }
116 static inline void DMSCRIPT_UnlockModule(void) { InterlockedDecrement( &DMSCRIPT_refCount ); }
117
118 /*****************************************************************************
119  * Misc.
120  */
121 /* for simpler reading */
122 typedef struct _DMUS_PRIVATE_CHUNK {
123         FOURCC fccID; /* FOURCC ID of the chunk */
124         DWORD dwSize; /* size of the chunk */
125 } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
126
127 /* used for generic dumping (copied from ddraw) */
128 typedef struct {
129     DWORD val;
130     const char* name;
131 } flag_info;
132
133 typedef struct {
134     const GUID *guid;
135     const char* name;
136 } guid_info;
137
138 /* used for initialising structs (primarily for DMUS_OBJECTDESC) */
139 #define DM_STRUCT_INIT(x)                               \
140         do {                                                            \
141                 memset((x), 0, sizeof(*(x)));   \
142                 (x)->dwSize = sizeof(*x);               \
143         } while (0)
144
145 #define FE(x) { x, #x } 
146 #define GE(x) { &x, #x }
147
148 #define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
149
150 /* check whether the given DWORD is even (return 0) or odd (return 1) */
151 extern int even_or_odd (DWORD number);
152 /* FOURCC to string conversion for debug messages */
153 extern const char *debugstr_fourcc (DWORD fourcc);
154 /* DMUS_VERSION struct to string conversion for debug messages */
155 extern const char *debugstr_dmversion (LPDMUS_VERSION version);
156 /* returns name of given GUID */
157 extern const char *debugstr_dmguid (const GUID *id);
158 /* returns name of given error code */
159 extern const char *debugstr_dmreturn (DWORD code);
160 /* generic flags-dumping function */
161 extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names);
162 extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask);
163 /* dump whole DMUS_OBJECTDESC struct */
164 extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc);
165
166 #endif  /* __WINE_DMSCRIPT_PRIVATE_H */