user32/tests: Test that class data is set with wrong size value too.
[wine/multimedia.git] / dlls / d3d10core / async.c
blob3f869a51c8b0440a1ae330a5786d8fc2b2554c63
1 /*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "config.h"
21 #include "wine/port.h"
23 #include "d3d10core_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
27 static inline struct d3d10_query *impl_from_ID3D10Query(ID3D10Query *iface)
29 return CONTAINING_RECORD(iface, struct d3d10_query, ID3D10Query_iface);
32 /* IUnknown methods */
34 static HRESULT STDMETHODCALLTYPE d3d10_query_QueryInterface(ID3D10Query *iface, REFIID riid, void **object)
36 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
38 if (IsEqualGUID(riid, &IID_ID3D10Query)
39 || IsEqualGUID(riid, &IID_ID3D10Asynchronous)
40 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
41 || IsEqualGUID(riid, &IID_IUnknown))
43 IUnknown_AddRef(iface);
44 *object = iface;
45 return S_OK;
48 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
50 *object = NULL;
51 return E_NOINTERFACE;
54 static ULONG STDMETHODCALLTYPE d3d10_query_AddRef(ID3D10Query *iface)
56 struct d3d10_query *This = impl_from_ID3D10Query(iface);
57 ULONG refcount = InterlockedIncrement(&This->refcount);
59 TRACE("%p increasing refcount to %u.\n", This, refcount);
61 return refcount;
64 static ULONG STDMETHODCALLTYPE d3d10_query_Release(ID3D10Query *iface)
66 struct d3d10_query *This = impl_from_ID3D10Query(iface);
67 ULONG refcount = InterlockedDecrement(&This->refcount);
69 TRACE("%p decreasing refcount to %u.\n", This, refcount);
71 if (!refcount)
73 HeapFree(GetProcessHeap(), 0, This);
76 return refcount;
79 /* ID3D10DeviceChild methods */
81 static void STDMETHODCALLTYPE d3d10_query_GetDevice(ID3D10Query *iface, ID3D10Device **device)
83 FIXME("iface %p, device %p stub!\n", iface, device);
86 static HRESULT STDMETHODCALLTYPE d3d10_query_GetPrivateData(ID3D10Query *iface,
87 REFGUID guid, UINT *data_size, void *data)
89 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
90 iface, debugstr_guid(guid), data_size, data);
92 return E_NOTIMPL;
95 static HRESULT STDMETHODCALLTYPE d3d10_query_SetPrivateData(ID3D10Query *iface,
96 REFGUID guid, UINT data_size, const void *data)
98 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
99 iface, debugstr_guid(guid), data_size, data);
101 return E_NOTIMPL;
104 static HRESULT STDMETHODCALLTYPE d3d10_query_SetPrivateDataInterface(ID3D10Query *iface,
105 REFGUID guid, const IUnknown *data)
107 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
109 return E_NOTIMPL;
112 /* ID3D10Asynchronous methods */
114 static void STDMETHODCALLTYPE d3d10_query_Begin(ID3D10Query *iface)
116 FIXME("iface %p stub!\n", iface);
119 static void STDMETHODCALLTYPE d3d10_query_End(ID3D10Query *iface)
121 FIXME("iface %p stub!\n", iface);
124 static HRESULT STDMETHODCALLTYPE d3d10_query_GetData(ID3D10Query *iface, void *data, UINT data_size, UINT flags)
126 FIXME("iface %p, data %p, data_size %u, flags %#x stub!\n", iface, data, data_size, flags);
128 return E_NOTIMPL;
131 static UINT STDMETHODCALLTYPE d3d10_query_GetDataSize(ID3D10Query *iface)
133 FIXME("iface %p stub!\n", iface);
135 return 0;
138 /* ID3D10Query methods */
140 static void STDMETHODCALLTYPE d3d10_query_GetDesc(ID3D10Query *iface, D3D10_QUERY_DESC *desc)
142 FIXME("iface %p, desc %p stub!\n", iface, desc);
145 static const struct ID3D10QueryVtbl d3d10_query_vtbl =
147 /* IUnknown methods */
148 d3d10_query_QueryInterface,
149 d3d10_query_AddRef,
150 d3d10_query_Release,
151 /* ID3D10DeviceChild methods */
152 d3d10_query_GetDevice,
153 d3d10_query_GetPrivateData,
154 d3d10_query_SetPrivateData,
155 d3d10_query_SetPrivateDataInterface,
156 /* ID3D10Asynchronous methods */
157 d3d10_query_Begin,
158 d3d10_query_End,
159 d3d10_query_GetData,
160 d3d10_query_GetDataSize,
161 /* ID3D10Query methods */
162 d3d10_query_GetDesc,
165 HRESULT d3d10_query_init(struct d3d10_query *query)
167 query->ID3D10Query_iface.lpVtbl = &d3d10_query_vtbl;
168 query->refcount = 1;
170 return S_OK;