Read and write binary files in binary mode on Windows.
[wine/multimedia.git] / dlls / dmusic / portdownload.c
blobd683d5757ad119aa8b2a57d4de73ee25410bdb32
1 /* IDirectMusicPortDownloadImpl Implementation
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 #include <stdarg.h>
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winuser.h"
25 #include "wingdi.h"
26 #include "wine/debug.h"
28 #include "dmusic_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
32 /* IDirectMusicPortDownload IUnknown parts follow: */
33 HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOWNLOAD iface, REFIID riid, LPVOID *ppobj)
35 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
37 if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPortDownload)) {
38 IDirectMusicPortDownloadImpl_AddRef(iface);
39 *ppobj = This;
40 return S_OK;
43 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
44 return E_NOINTERFACE;
47 ULONG WINAPI IDirectMusicPortDownloadImpl_AddRef (LPDIRECTMUSICPORTDOWNLOAD iface)
49 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
50 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
51 return ++(This->ref);
54 ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD iface)
56 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
57 ULONG ref = --This->ref;
58 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
59 if (ref == 0) {
60 HeapFree(GetProcessHeap(), 0, This);
62 return ref;
65 /* IDirectMusicPortDownload Interface follow: */
66 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload)
68 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
70 FIXME("(%p, %ld, %p): stub\n", This, dwDLId, ppIDMDownload);
72 return S_OK;
75 HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload)
77 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
79 FIXME("(%p, %ld, %p): stub\n", This, dwSize, ppIDMDownload);
81 return S_OK;
84 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetDLId (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwStartDLId, DWORD dwCount)
86 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
88 FIXME("(%p, %p, %ld): stub\n", This, pdwStartDLId, dwCount);
90 return S_OK;
93 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetAppend (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwAppend)
95 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
97 FIXME("(%p, %p): stub\n", This, pdwAppend);
99 return S_OK;
102 HRESULT WINAPI IDirectMusicPortDownloadImpl_Download (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload)
104 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
106 FIXME("(%p, %p): stub\n", This, pIDMDownload);
108 return S_OK;
111 HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload)
113 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
115 FIXME("(%p, %p): stub\n", This, pIDMDownload);
117 return S_OK;
120 ICOM_VTABLE(IDirectMusicPortDownload) DirectMusicPortDownload_Vtbl =
122 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
123 IDirectMusicPortDownloadImpl_QueryInterface,
124 IDirectMusicPortDownloadImpl_AddRef,
125 IDirectMusicPortDownloadImpl_Release,
126 IDirectMusicPortDownloadImpl_GetBuffer,
127 IDirectMusicPortDownloadImpl_AllocateBuffer,
128 IDirectMusicPortDownloadImpl_GetDLId,
129 IDirectMusicPortDownloadImpl_GetAppend,
130 IDirectMusicPortDownloadImpl_Download,
131 IDirectMusicPortDownloadImpl_Unload
134 /* for ClassFactory */
135 HRESULT WINAPI DMUSIC_CreateDirectMusicPortDownload (LPCGUID lpcGUID, LPDIRECTMUSICPORTDOWNLOAD* ppDMPortDL, LPUNKNOWN pUnkOuter)
137 if (IsEqualIID (lpcGUID, &IID_IDirectMusicPortDownload))
139 FIXME("Not yet\n");
140 return E_NOINTERFACE;
143 WARN("No interface found\n");
144 return E_NOINTERFACE;