Removed some more uses of the non-standard ICOM_THIS macro.
[wine/multimedia.git] / dlls / d3d9 / volume.c
blob0fcb8bec594dfd0e9faba708c6f8c99031081716
1 /*
2 * IDirect3DVolume9 implementation
4 * Copyright 2002-2003 Jason Edmeades
5 * Raphael Junqueira
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include "config.h"
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
26 #include <stdarg.h>
28 #include "windef.h"
29 #include "winbase.h"
30 #include "winuser.h"
31 #include "wingdi.h"
32 #include "wine/debug.h"
34 #include "d3d9_private.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
38 /* IDirect3DVolume9 IUnknown parts follow: */
39 HRESULT WINAPI IDirect3DVolume9Impl_QueryInterface(LPDIRECT3DVOLUME9 iface, REFIID riid, LPVOID* ppobj) {
40 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
42 if (IsEqualGUID(riid, &IID_IUnknown)
43 || IsEqualGUID(riid, &IID_IDirect3DVolume9)) {
44 IDirect3DVolume9Impl_AddRef(iface);
45 *ppobj = This;
46 return D3D_OK;
49 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
50 return E_NOINTERFACE;
53 ULONG WINAPI IDirect3DVolume9Impl_AddRef(LPDIRECT3DVOLUME9 iface) {
54 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
55 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
56 return ++(This->ref);
59 ULONG WINAPI IDirect3DVolume9Impl_Release(LPDIRECT3DVOLUME9 iface) {
60 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
61 ULONG ref = --This->ref;
62 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
63 if (ref == 0) {
64 HeapFree(GetProcessHeap(), 0, This->allocatedMemory);
65 HeapFree(GetProcessHeap(), 0, This);
67 return ref;
70 /* IDirect3DVolume9 Interface follow: */
71 HRESULT WINAPI IDirect3DVolume9Impl_GetDevice(LPDIRECT3DVOLUME9 iface, IDirect3DDevice9** ppDevice) {
72 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
73 TRACE("(%p) : returning %p\n", This, This->Device);
74 *ppDevice = (LPDIRECT3DDEVICE9) This->Device;
76 /* Note Calling this method will increase the internal reference count
77 on the IDirect3DDevice9 interface. */
78 IDirect3DDevice9Impl_AddRef(*ppDevice);
80 return D3D_OK;
83 HRESULT WINAPI IDirect3DVolume9Impl_SetPrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
84 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
85 FIXME("(%p) : stub\n", This);
86 return D3D_OK;
89 HRESULT WINAPI IDirect3DVolume9Impl_GetPrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
90 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
91 FIXME("(%p) : stub\n", This);
92 return D3D_OK;
95 HRESULT WINAPI IDirect3DVolume9Impl_FreePrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid) {
96 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
97 FIXME("(%p) : stub\n", This);
98 return D3D_OK;
101 HRESULT WINAPI IDirect3DVolume9Impl_GetContainer(LPDIRECT3DVOLUME9 iface, REFIID riid, void** ppContainer) {
102 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
103 TRACE("(%p) : returning %p\n", This, This->Container);
104 *ppContainer = This->Container;
105 IUnknown_AddRef(This->Container);
106 return D3D_OK;
109 HRESULT WINAPI IDirect3DVolume9Impl_GetDesc(LPDIRECT3DVOLUME9 iface, D3DVOLUME_DESC* pDesc) {
110 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
111 TRACE("(%p) : copying into %p\n", This, pDesc);
112 memcpy(pDesc, &This->myDesc, sizeof(D3DVOLUME_DESC));
113 return D3D_OK;
116 HRESULT WINAPI IDirect3DVolume9Impl_LockBox(LPDIRECT3DVOLUME9 iface, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) {
117 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
118 FIXME("(%p) : stub\n", This);
119 return D3D_OK;
122 HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface) {
123 IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
124 FIXME("(%p) : stub\n", This);
125 return D3D_OK;
129 IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl =
131 IDirect3DVolume9Impl_QueryInterface,
132 IDirect3DVolume9Impl_AddRef,
133 IDirect3DVolume9Impl_Release,
134 IDirect3DVolume9Impl_GetDevice,
135 IDirect3DVolume9Impl_SetPrivateData,
136 IDirect3DVolume9Impl_GetPrivateData,
137 IDirect3DVolume9Impl_FreePrivateData,
138 IDirect3DVolume9Impl_GetContainer,
139 IDirect3DVolume9Impl_GetDesc,
140 IDirect3DVolume9Impl_LockBox,
141 IDirect3DVolume9Impl_UnlockBox