- correct return value of SHGetPathFromIDList[AW]() for virtual
[wine] / dlls / dmusic / download.c
1 /* IDirectMusicDownload 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 <stdarg.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 /* IDirectMusicDownload IUnknown parts follow: */
42 HRESULT WINAPI IDirectMusicDownloadImpl_QueryInterface (LPDIRECTMUSICDOWNLOAD iface, REFIID riid, LPVOID *ppobj)
43 {
44         ICOM_THIS(IDirectMusicDownloadImpl,iface);
45
46         if (IsEqualIID (riid, &IID_IUnknown) 
47                 || IsEqualIID (riid, &IID_IDirectMusicDownload)) {
48                 IDirectMusicDownloadImpl_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 IDirectMusicDownloadImpl_AddRef (LPDIRECTMUSICDOWNLOAD iface)
58 {
59         ICOM_THIS(IDirectMusicDownloadImpl,iface);
60         TRACE("(%p) : AddRef from %ld\n", This, This->ref);
61         return ++(This->ref);
62 }
63
64 ULONG WINAPI IDirectMusicDownloadImpl_Release (LPDIRECTMUSICDOWNLOAD iface)
65 {
66         ICOM_THIS(IDirectMusicDownloadImpl,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 /* IDirectMusicDownload Interface follow: */
76 HRESULT WINAPI IDirectMusicDownloadImpl_GetBuffer (LPDIRECTMUSICDOWNLOAD iface, void** ppvBuffer, DWORD* pdwSize)
77 {
78         ICOM_THIS(IDirectMusicDownloadImpl,iface);
79
80         FIXME("(%p,%p, %p): stub\n", This, ppvBuffer, pdwSize);
81
82         return S_OK;
83 }
84
85 ICOM_VTABLE(IDirectMusicDownload) DirectMusicDownload_Vtbl =
86 {
87     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
88         IDirectMusicDownloadImpl_QueryInterface,
89         IDirectMusicDownloadImpl_AddRef,
90         IDirectMusicDownloadImpl_Release,
91         IDirectMusicDownloadImpl_GetBuffer
92 };
93
94 /* for ClassFactory */
95 HRESULT WINAPI DMUSIC_CreateDirectMusicDownload (LPCGUID lpcGUID, LPDIRECTMUSICDOWNLOAD* ppDMDL, LPUNKNOWN pUnkOuter)
96 {
97         if (IsEqualIID (lpcGUID, &IID_IDirectMusicDownload)) {
98                 FIXME("Not yet\n");
99                 return E_NOINTERFACE;
100         }
101         
102         WARN("No interface found\n");
103         return E_NOINTERFACE;   
104 }