- some cleanups and fixes on d3d8 and d3d9 headers
[wine/multimedia.git] / dlls / d3d9 / resource.c
blob8996212cad6067d4c6506bc2fbb9011b01e3b51c
1 /*
2 * IDirect3DResource9 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 "windef.h"
27 #include "winbase.h"
28 #include "winuser.h"
29 #include "wingdi.h"
30 #include "wine/debug.h"
32 #include "d3d9_private.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
36 /* IDirect3DResource9 IUnknown parts follow: */
37 HRESULT WINAPI IDirect3DResource9Impl_QueryInterface(LPDIRECT3DRESOURCE9 iface, REFIID riid, LPVOID* ppobj) {
38 ICOM_THIS(IDirect3DResource9Impl,iface);
40 if (IsEqualGUID(riid, &IID_IUnknown)
41 || IsEqualGUID(riid, &IID_IDirect3DResource9)) {
42 IDirect3DResource9Impl_AddRef(iface);
43 *ppobj = This;
44 return D3D_OK;
47 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
48 return E_NOINTERFACE;
51 ULONG WINAPI IDirect3DResource9Impl_AddRef(LPDIRECT3DRESOURCE9 iface) {
52 ICOM_THIS(IDirect3DResource9Impl,iface);
53 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
54 return ++(This->ref);
57 ULONG WINAPI IDirect3DResource9Impl_Release(LPDIRECT3DRESOURCE9 iface) {
58 ICOM_THIS(IDirect3DResource9Impl,iface);
59 ULONG ref = --This->ref;
60 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
61 if (ref == 0) {
62 HeapFree(GetProcessHeap(), 0, This);
64 return ref;
67 /* IDirect3DResource9 Interface follow: */
68 HRESULT WINAPI IDirect3DResource9Impl_GetDevice(LPDIRECT3DRESOURCE9 iface, IDirect3DDevice9** ppDevice) {
69 ICOM_THIS(IDirect3DResource9Impl,iface);
70 TRACE("(%p) : returning %p\n", This, This->Device);
71 *ppDevice = (LPDIRECT3DDEVICE9) This->Device;
72 IDirect3DDevice9Impl_AddRef(*ppDevice);
73 return D3D_OK;
76 HRESULT WINAPI IDirect3DResource9Impl_SetPrivateData(LPDIRECT3DRESOURCE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
77 ICOM_THIS(IDirect3DResource9Impl,iface);
78 FIXME("(%p) : stub\n", This);
79 return D3D_OK;
82 HRESULT WINAPI IDirect3DResource9Impl_GetPrivateData(LPDIRECT3DRESOURCE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
83 ICOM_THIS(IDirect3DResource9Impl,iface);
84 FIXME("(%p) : stub\n", This);
85 return D3D_OK;
88 HRESULT WINAPI IDirect3DResource9Impl_FreePrivateData(LPDIRECT3DRESOURCE9 iface, REFGUID refguid) {
89 ICOM_THIS(IDirect3DResource9Impl,iface);
90 FIXME("(%p) : stub\n", This);
91 return D3D_OK;
94 DWORD WINAPI IDirect3DResource9Impl_SetPriority(LPDIRECT3DRESOURCE9 iface, DWORD PriorityNew) {
95 ICOM_THIS(IDirect3DResource9Impl,iface);
96 FIXME("(%p) : stub\n", This);
97 return 0;
100 DWORD WINAPI IDirect3DResource9Impl_GetPriority(LPDIRECT3DRESOURCE9 iface) {
101 ICOM_THIS(IDirect3DResource9Impl,iface);
102 FIXME("(%p) : stub\n", This);
103 return 0;
106 void WINAPI IDirect3DResource9Impl_PreLoad(LPDIRECT3DRESOURCE9 iface) {
107 ICOM_THIS(IDirect3DResource9Impl,iface);
108 FIXME("(%p) : stub\n", This);
111 D3DRESOURCETYPE WINAPI IDirect3DResource9Impl_GetType(LPDIRECT3DRESOURCE9 iface) {
112 ICOM_THIS(IDirect3DResource9Impl,iface);
113 TRACE("(%p) : returning %d\n", This, This->ResourceType);
114 return This->ResourceType;
118 ICOM_VTABLE(IDirect3DResource9) Direct3DResource9_Vtbl =
120 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
121 IDirect3DResource9Impl_QueryInterface,
122 IDirect3DResource9Impl_AddRef,
123 IDirect3DResource9Impl_Release,
124 IDirect3DResource9Impl_GetDevice,
125 IDirect3DResource9Impl_SetPrivateData,
126 IDirect3DResource9Impl_GetPrivateData,
127 IDirect3DResource9Impl_FreePrivateData,
128 IDirect3DResource9Impl_SetPriority,
129 IDirect3DResource9Impl_GetPriority,
130 IDirect3DResource9Impl_PreLoad,
131 IDirect3DResource9Impl_GetType