portdownload.c 4.27 KB
Newer Older
1 2
/* IDirectMusicPortDownloadImpl Implementation
 *
3
 * Copyright (C) 2003-2004 Rok Mandeljc
4
 *
5 6 7 8
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
9 10 11
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
14
 *
15 16 17
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 19 20 21 22 23 24
 */

#include "dmusic_private.h"

WINE_DEFAULT_DEBUG_CHANNEL(dmusic);

/* IDirectMusicPortDownload IUnknown parts follow: */
25
static HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOWNLOAD iface, REFIID riid, LPVOID *ppobj) {
26
	IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
27
	TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
28

29
	if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPortDownload)) {
30
		IUnknown_AddRef(iface);
31 32 33
		*ppobj = This;
		return S_OK;
	}
34
	WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
35 36 37
	return E_NOINTERFACE;
}

38
static ULONG WINAPI IDirectMusicPortDownloadImpl_AddRef (LPDIRECTMUSICPORTDOWNLOAD iface) {
39
	IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
40 41
	ULONG refCount = InterlockedIncrement(&This->ref);

42
	TRACE("(%p)->(ref before=%u)\n", This, refCount - 1);
43

44 45
	DMUSIC_LockModule();

46
	return refCount;
47 48
}

49
static ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD iface) {
50
	IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
51 52
	ULONG refCount = InterlockedDecrement(&This->ref);

53
	TRACE("(%p)->(ref before=%u)\n", This, refCount + 1);
54 55

	if (!refCount) {
56 57
		HeapFree(GetProcessHeap(), 0, This);
	}
58 59 60

	DMUSIC_UnlockModule();

61
	return refCount;
62 63 64
}

/* IDirectMusicPortDownload Interface follow: */
65
static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload) {
66
	IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
67
	FIXME("(%p, %d, %p): stub\n", This, dwDLId, ppIDMDownload);
68 69 70
	return S_OK;
}

71
static HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload) {
72
	IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
73
	FIXME("(%p, %d, %p): stub\n", This, dwSize, ppIDMDownload);
74 75 76
	return S_OK;
}

77
static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetDLId (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwStartDLId, DWORD dwCount) {
78
	IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
79
	FIXME("(%p, %p, %d): stub\n", This, pdwStartDLId, dwCount);
80 81 82
	return S_OK;
}

83
static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetAppend (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwAppend) {
84
	IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
85 86 87 88
	FIXME("(%p, %p): stub\n", This, pdwAppend);
	return S_OK;
}

89
static HRESULT WINAPI IDirectMusicPortDownloadImpl_Download (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
90
	IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
91 92 93 94
	FIXME("(%p, %p): stub\n", This, pIDMDownload);
	return S_OK;
}

95
static HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload) {
96
	IDirectMusicPortDownloadImpl *This = (IDirectMusicPortDownloadImpl *)iface;
97 98 99 100
	FIXME("(%p, %p): stub\n", This, pIDMDownload);
	return S_OK;
}

101
static const IDirectMusicPortDownloadVtbl DirectMusicPortDownload_Vtbl = {
102 103 104 105 106 107 108 109 110 111
	IDirectMusicPortDownloadImpl_QueryInterface,
	IDirectMusicPortDownloadImpl_AddRef,
	IDirectMusicPortDownloadImpl_Release,
	IDirectMusicPortDownloadImpl_GetBuffer,
	IDirectMusicPortDownloadImpl_AllocateBuffer,
	IDirectMusicPortDownloadImpl_GetDLId,
	IDirectMusicPortDownloadImpl_GetAppend,
	IDirectMusicPortDownloadImpl_Download,
	IDirectMusicPortDownloadImpl_Unload
};