Removed W->A from DEFWND_ImmIsUIMessageW.
[wine] / dlls / d3d9 / volume.c
1 /*
2  * IDirect3DVolume9 implementation
3  *
4  * Copyright 2002-2003 Jason Edmeades
5  *                     Raphael Junqueira
6  *
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.
11  *
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.
16  *
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
20  */
21
22 #include "config.h"
23 #include "d3d9_private.h"
24
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
26
27 /* IDirect3DVolume9 IUnknown parts follow: */
28 HRESULT WINAPI IDirect3DVolume9Impl_QueryInterface(LPDIRECT3DVOLUME9 iface, REFIID riid, LPVOID* ppobj) {
29     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
30
31     if (IsEqualGUID(riid, &IID_IUnknown)
32         || IsEqualGUID(riid, &IID_IDirect3DVolume9)) {
33         IDirect3DVolume9Impl_AddRef(iface);
34         *ppobj = This;
35         return D3D_OK;
36     }
37
38     WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
39     return E_NOINTERFACE;
40 }
41
42 ULONG WINAPI IDirect3DVolume9Impl_AddRef(LPDIRECT3DVOLUME9 iface) {
43     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
44     TRACE("(%p) : AddRef from %ld\n", This, This->ref);
45     return ++(This->ref);
46 }
47
48 ULONG WINAPI IDirect3DVolume9Impl_Release(LPDIRECT3DVOLUME9 iface) {
49     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
50     ULONG ref = --This->ref;
51     TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
52     if (ref == 0) {
53         HeapFree(GetProcessHeap(), 0, This->allocatedMemory);
54         HeapFree(GetProcessHeap(), 0, This);
55     }
56     return ref;
57 }
58
59 /* IDirect3DVolume9 Interface follow: */
60 HRESULT WINAPI IDirect3DVolume9Impl_GetDevice(LPDIRECT3DVOLUME9 iface, IDirect3DDevice9** ppDevice) {
61     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
62     TRACE("(%p) : returning %p\n", This, This->Device);
63     *ppDevice = (LPDIRECT3DDEVICE9) This->Device;
64
65     /* Note  Calling this method will increase the internal reference count 
66        on the IDirect3DDevice9 interface. */
67     IDirect3DDevice9Impl_AddRef(*ppDevice);
68
69     return D3D_OK;
70 }
71
72 HRESULT WINAPI IDirect3DVolume9Impl_SetPrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
73     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
74     FIXME("(%p) : stub\n", This);    
75     return D3D_OK;
76 }
77
78 HRESULT WINAPI IDirect3DVolume9Impl_GetPrivateData(LPDIRECT3DVOLUME9 iface, REFGUID  refguid, void* pData, DWORD* pSizeOfData) {
79     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
80     FIXME("(%p) : stub\n", This);    
81     return D3D_OK;
82 }
83
84 HRESULT WINAPI IDirect3DVolume9Impl_FreePrivateData(LPDIRECT3DVOLUME9 iface, REFGUID refguid) {
85     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
86     FIXME("(%p) : stub\n", This);    
87     return D3D_OK;
88 }
89
90 HRESULT WINAPI IDirect3DVolume9Impl_GetContainer(LPDIRECT3DVOLUME9 iface, REFIID riid, void** ppContainer) {
91     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
92     TRACE("(%p) : returning %p\n", This, This->Container);
93     *ppContainer = This->Container;
94     IUnknown_AddRef(This->Container);
95     return D3D_OK;
96 }
97
98 HRESULT WINAPI IDirect3DVolume9Impl_GetDesc(LPDIRECT3DVOLUME9 iface, D3DVOLUME_DESC* pDesc) {
99     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
100     TRACE("(%p) : copying into %p\n", This, pDesc);
101     memcpy(pDesc, &This->myDesc, sizeof(D3DVOLUME_DESC));
102     return D3D_OK;
103 }
104
105 HRESULT WINAPI IDirect3DVolume9Impl_LockBox(LPDIRECT3DVOLUME9 iface, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags) {
106     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
107     FIXME("(%p) : stub\n", This);    
108     return D3D_OK;
109 }
110
111 HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface) {
112     IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
113     FIXME("(%p) : stub\n", This);    
114     return D3D_OK;
115 }
116
117
118 IDirect3DVolume9Vtbl Direct3DVolume9_Vtbl =
119 {
120     IDirect3DVolume9Impl_QueryInterface,
121     IDirect3DVolume9Impl_AddRef,
122     IDirect3DVolume9Impl_Release,
123     IDirect3DVolume9Impl_GetDevice,
124     IDirect3DVolume9Impl_SetPrivateData,
125     IDirect3DVolume9Impl_GetPrivateData,
126     IDirect3DVolume9Impl_FreePrivateData,
127     IDirect3DVolume9Impl_GetContainer,
128     IDirect3DVolume9Impl_GetDesc,
129     IDirect3DVolume9Impl_LockBox,
130     IDirect3DVolume9Impl_UnlockBox
131 };