First step in using faster approach for A<->W message mapping.
[wine] / dlls / dmusic / portdownload.c
1 /* IDirectMusicPortDownloadImpl Implementation
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 #include "dmusic_private.h"
21
22 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
23
24 /* IDirectMusicPortDownload IUnknown parts follow: */
25 HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOWNLOAD iface, REFIID riid, LPVOID *ppobj) {
26         ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
27
28         if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPortDownload)) {
29                 IDirectMusicPortDownloadImpl_AddRef(iface);
30                 *ppobj = This;
31                 return S_OK;
32         }
33         WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
34         return E_NOINTERFACE;
35 }
36
37 ULONG WINAPI IDirectMusicPortDownloadImpl_AddRef (LPDIRECTMUSICPORTDOWNLOAD iface) {
38         ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
39         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
40         return ++(This->ref);
41 }
42
43 ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD iface) {
44         ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
45         ULONG ref = --This->ref;
46         TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
47         if (ref == 0) {
48                 HeapFree(GetProcessHeap(), 0, This);
49         }
50         return ref;
51 }
52
53 /* IDirectMusicPortDownload Interface follow: */
54 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload) {
55         ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
56         FIXME("(%p, %ld, %p): stub\n", This, dwDLId, ppIDMDownload);
57         return S_OK;
58 }
59
60 HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload) {
61         ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
62         FIXME("(%p, %ld, %p): stub\n", This, dwSize, ppIDMDownload);
63         return S_OK;
64 }
65
66 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetDLId (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwStartDLId, DWORD dwCount) {
67         ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
68         FIXME("(%p, %p, %ld): stub\n", This, pdwStartDLId, dwCount);
69         return S_OK;
70 }
71
72 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetAppend (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwAppend) {
73         ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
74         FIXME("(%p, %p): stub\n", This, pdwAppend);
75         return S_OK;
76 }
77
78 HRESULT WINAPI IDirectMusicPortDownloadImpl_Download (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
79         ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
80         FIXME("(%p, %p): stub\n", This, pIDMDownload);
81         return S_OK;
82 }
83
84 HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
85         ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
86         FIXME("(%p, %p): stub\n", This, pIDMDownload);
87         return S_OK;
88 }
89
90 ICOM_VTABLE(IDirectMusicPortDownload) DirectMusicPortDownload_Vtbl = {
91     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
92         IDirectMusicPortDownloadImpl_QueryInterface,
93         IDirectMusicPortDownloadImpl_AddRef,
94         IDirectMusicPortDownloadImpl_Release,
95         IDirectMusicPortDownloadImpl_GetBuffer,
96         IDirectMusicPortDownloadImpl_AllocateBuffer,
97         IDirectMusicPortDownloadImpl_GetDLId,
98         IDirectMusicPortDownloadImpl_GetAppend,
99         IDirectMusicPortDownloadImpl_Download,
100         IDirectMusicPortDownloadImpl_Unload
101 };