Fixed bug parsing /proc/net/arp for arp table.
[wine] / dlls / dmusic / buffer.c
1 /* IDirectMusicBuffer Implementation
2  *
3  * Copyright (C) 2003 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 #include "config.h"
21
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winreg.h"
25 #include "winuser.h"
26 #include "wingdi.h"
27 #include "winuser.h"
28 #include "winerror.h"
29 #include "mmsystem.h"
30 #include "winternl.h"
31 #include "mmddk.h"
32 #include "wine/windef16.h"
33 #include "wine/winbase16.h"
34 #include "wine/debug.h"
35 #include "dsound.h"
36
37 #include "dmusic_private.h"
38
39 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
40
41 /* IDirectMusicBuffer IUnknown parts follow: */
42 HRESULT WINAPI IDirectMusicBufferImpl_QueryInterface (LPDIRECTMUSICBUFFER iface, REFIID riid, LPVOID *ppobj)
43 {
44         ICOM_THIS(IDirectMusicBufferImpl,iface);
45
46         if (IsEqualIID (riid, &IID_IUnknown) 
47                 || IsEqualIID (riid, &IID_IDirectMusicBuffer)) {
48                 IDirectMusicBufferImpl_AddRef(iface);
49                 *ppobj = This;
50                 return S_OK;
51         }
52
53         WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
54         return E_NOINTERFACE;
55 }
56
57 ULONG WINAPI IDirectMusicBufferImpl_AddRef (LPDIRECTMUSICBUFFER iface)
58 {
59         ICOM_THIS(IDirectMusicBufferImpl,iface);
60         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
61         return ++(This->ref);
62 }
63
64 ULONG WINAPI IDirectMusicBufferImpl_Release (LPDIRECTMUSICBUFFER iface)
65 {
66         ICOM_THIS(IDirectMusicBufferImpl,iface);
67         ULONG ref = --This->ref;
68         TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
69         if (ref == 0) {
70                 HeapFree(GetProcessHeap(), 0, This);
71         }
72         return ref;
73 }
74
75 /* IDirectMusicBuffer Interface follow: */
76 HRESULT WINAPI IDirectMusicBufferImpl_Flush (LPDIRECTMUSICBUFFER iface)
77 {
78         ICOM_THIS(IDirectMusicBufferImpl,iface);
79
80         FIXME("(%p): stub\n", This);
81
82         return S_OK;
83 }
84
85 HRESULT WINAPI IDirectMusicBufferImpl_TotalTime (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prtTime)
86 {
87         ICOM_THIS(IDirectMusicBufferImpl,iface);
88         
89         FIXME("(%p, %p): stub\n", This, prtTime);
90         
91         return S_OK;
92 }
93
94 HRESULT WINAPI IDirectMusicBufferImpl_PackStructured (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD dwChannelMessage)
95 {
96         ICOM_THIS(IDirectMusicBufferImpl,iface);
97
98         FIXME("(%p, %lli, %ld, %ld): stub\n", This, rt, dwChannelGroup, dwChannelMessage);
99
100         return S_OK;
101 }
102
103 HRESULT WINAPI IDirectMusicBufferImpl_PackUnstructured (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD cb, LPBYTE lpb)
104 {
105         ICOM_THIS(IDirectMusicBufferImpl,iface);
106
107         FIXME("(%p, %lli, %ld, %ld, %p): stub\n", This, rt, dwChannelGroup, cb, lpb);
108         
109         return S_OK;
110 }
111
112 HRESULT WINAPI IDirectMusicBufferImpl_ResetReadPtr (LPDIRECTMUSICBUFFER iface)
113 {
114         ICOM_THIS(IDirectMusicBufferImpl,iface);
115
116         FIXME("(%p): stub\n", This);
117
118         return S_OK;
119 }
120
121 HRESULT WINAPI IDirectMusicBufferImpl_GetNextEvent (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prt, LPDWORD pdwChannelGroup, LPDWORD pdwLength, LPBYTE* ppData)
122 {
123         ICOM_THIS(IDirectMusicBufferImpl,iface);
124
125         FIXME("(%p, %p, %p, %p, %p): stub\n", This, prt, pdwChannelGroup, pdwLength, ppData);
126
127         return S_OK;
128 }
129
130 HRESULT WINAPI IDirectMusicBufferImpl_GetRawBufferPtr (LPDIRECTMUSICBUFFER iface, LPBYTE* ppData)
131 {
132         ICOM_THIS(IDirectMusicBufferImpl,iface);
133
134         FIXME("(%p, %p): stub\n", This, ppData);
135
136         return S_OK;
137 }
138
139 HRESULT WINAPI IDirectMusicBufferImpl_GetStartTime (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prt)
140 {
141         ICOM_THIS(IDirectMusicBufferImpl,iface);
142
143         FIXME("(%p, %p): stub\n", This, prt);
144
145         return S_OK;
146 }
147
148 HRESULT WINAPI IDirectMusicBufferImpl_GetUsedBytes (LPDIRECTMUSICBUFFER iface, LPDWORD pcb)
149 {
150         ICOM_THIS(IDirectMusicBufferImpl,iface);
151
152         FIXME("(%p, %p): stub\n", This, pcb);
153
154         return S_OK;
155 }
156
157 HRESULT WINAPI IDirectMusicBufferImpl_GetMaxBytes (LPDIRECTMUSICBUFFER iface, LPDWORD pcb)
158 {
159         ICOM_THIS(IDirectMusicBufferImpl,iface);
160
161         FIXME("(%p, %p): stub\n", This, pcb);
162
163         return S_OK;
164 }
165
166 HRESULT WINAPI IDirectMusicBufferImpl_GetBufferFormat (LPDIRECTMUSICBUFFER iface, LPGUID pGuidFormat)
167 {
168         ICOM_THIS(IDirectMusicBufferImpl,iface);
169
170         FIXME("(%p, %p): stub\n", This, pGuidFormat);
171
172         return S_OK;
173 }
174
175 HRESULT WINAPI IDirectMusicBufferImpl_SetStartTime (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt)
176 {
177         ICOM_THIS(IDirectMusicBufferImpl,iface);
178
179         FIXME("(%p, %lli): stub\n", This, rt);
180
181         return S_OK;
182 }
183
184 HRESULT WINAPI IDirectMusicBufferImpl_SetUsedBytes (LPDIRECTMUSICBUFFER iface, DWORD cb)
185 {
186         ICOM_THIS(IDirectMusicBufferImpl,iface);
187
188         FIXME("(%p, %ld): stub\n", This, cb);
189
190         return S_OK;
191 }
192
193 ICOM_VTABLE(IDirectMusicBuffer) DirectMusicBuffer_Vtbl =
194 {
195     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
196         IDirectMusicBufferImpl_QueryInterface,
197         IDirectMusicBufferImpl_AddRef,
198         IDirectMusicBufferImpl_Release,
199         IDirectMusicBufferImpl_Flush,
200         IDirectMusicBufferImpl_TotalTime,
201         IDirectMusicBufferImpl_PackStructured,
202         IDirectMusicBufferImpl_PackUnstructured,
203         IDirectMusicBufferImpl_ResetReadPtr,
204         IDirectMusicBufferImpl_GetNextEvent,
205         IDirectMusicBufferImpl_GetRawBufferPtr,
206         IDirectMusicBufferImpl_GetStartTime,
207         IDirectMusicBufferImpl_GetUsedBytes,
208         IDirectMusicBufferImpl_GetMaxBytes,
209         IDirectMusicBufferImpl_GetBufferFormat,
210         IDirectMusicBufferImpl_SetStartTime,
211         IDirectMusicBufferImpl_SetUsedBytes
212 };
213
214 /* for ClassFactory */
215 HRESULT WINAPI DMUSIC_CreateDirectMusicBuffer (LPCGUID lpcGUID, LPDIRECTMUSICBUFFER* ppDMBuff, LPUNKNOWN pUnkOuter)
216 {
217         if (IsEqualIID (lpcGUID, &IID_IDirectMusicBuffer)) {
218                 FIXME("Not yet\n");
219                 return E_NOINTERFACE;
220         }
221         
222         WARN("No interface found\n");
223         return E_NOINTERFACE;   
224 }