d3drm: Implement IDirect3DRMDeviceX_[Get|Set]Dither.
[wine] / dlls / d3drm / device.c
1 /*
2  * Implementation of IDirect3DRMDevice Interface
3  *
4  * Copyright 2011, 2012 AndrĂ© Hentschel
5  *
6  * This file contains the (internal) driver registration functions,
7  * driver enumeration APIs and DirectDraw creation functions.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23
24 #include "wine/debug.h"
25
26 #define COBJMACROS
27
28 #include "winbase.h"
29 #include "wingdi.h"
30
31 #include "d3drm_private.h"
32 #include "initguid.h"
33 #include "d3drmwin.h"
34
35 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
36
37 typedef struct {
38     IDirect3DRMDevice2 IDirect3DRMDevice2_iface;
39     IDirect3DRMDevice3 IDirect3DRMDevice3_iface;
40     IDirect3DRMWinDevice IDirect3DRMWinDevice_iface;
41     LONG ref;
42     BOOL dither;
43 } IDirect3DRMDeviceImpl;
44
45 static inline IDirect3DRMDeviceImpl *impl_from_IDirect3DRMDevice2(IDirect3DRMDevice2 *iface)
46 {
47     return CONTAINING_RECORD(iface, IDirect3DRMDeviceImpl, IDirect3DRMDevice2_iface);
48 }
49
50 static inline IDirect3DRMDeviceImpl *impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface)
51 {
52     return CONTAINING_RECORD(iface, IDirect3DRMDeviceImpl, IDirect3DRMDevice3_iface);
53 }
54
55 static inline IDirect3DRMDeviceImpl *impl_from_IDirect3DRMWinDevice(IDirect3DRMWinDevice *iface)
56 {
57     return CONTAINING_RECORD(iface, IDirect3DRMDeviceImpl, IDirect3DRMWinDevice_iface);
58 }
59
60 /*** IUnknown methods ***/
61 static HRESULT WINAPI IDirect3DRMDevice2Impl_QueryInterface(IDirect3DRMDevice2* iface,
62                                                             REFIID riid, void** object)
63 {
64     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
65
66     TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), object);
67
68     *object = NULL;
69
70     if (IsEqualGUID(riid, &IID_IUnknown) ||
71         IsEqualGUID(riid, &IID_IDirect3DRMDevice) ||
72         IsEqualGUID(riid, &IID_IDirect3DRMDevice2))
73     {
74         *object = &This->IDirect3DRMDevice2_iface;
75     }
76     else if(IsEqualGUID(riid, &IID_IDirect3DRMDevice3))
77     {
78         *object = &This->IDirect3DRMDevice3_iface;
79     }
80     else if(IsEqualGUID(riid, &IID_IDirect3DRMWinDevice))
81     {
82         *object = &This->IDirect3DRMWinDevice_iface;
83     }
84     else
85     {
86         FIXME("interface %s not implemented\n", debugstr_guid(riid));
87         return E_NOINTERFACE;
88     }
89
90     IDirect3DRMDevice2_AddRef(iface);
91     return S_OK;
92 }
93
94 static ULONG WINAPI IDirect3DRMDevice2Impl_AddRef(IDirect3DRMDevice2* iface)
95 {
96     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
97     ULONG ref = InterlockedIncrement(&This->ref);
98
99     TRACE("(%p)->(): new ref = %d\n", iface, ref);
100
101     return ref;
102 }
103
104 static ULONG WINAPI IDirect3DRMDevice2Impl_Release(IDirect3DRMDevice2* iface)
105 {
106     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
107     ULONG ref = InterlockedDecrement(&This->ref);
108
109     TRACE("(%p)->(): new ref = %d\n", iface, ref);
110
111     if (!ref)
112         HeapFree(GetProcessHeap(), 0, This);
113
114     return ref;
115 }
116
117 /*** IDirect3DRMObject methods ***/
118 static HRESULT WINAPI IDirect3DRMDevice2Impl_Clone(IDirect3DRMDevice2* iface,
119                                                         LPUNKNOWN unkwn, REFIID riid,
120                                                         LPVOID* object)
121 {
122     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
123
124     FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
125
126     return E_NOTIMPL;
127 }
128
129 static HRESULT WINAPI IDirect3DRMDevice2Impl_AddDestroyCallback(IDirect3DRMDevice2* iface,
130                                                                      D3DRMOBJECTCALLBACK cb,
131                                                                      LPVOID argument)
132 {
133     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
134
135     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
136
137     return E_NOTIMPL;
138 }
139
140 static HRESULT WINAPI IDirect3DRMDevice2Impl_DeleteDestroyCallback(IDirect3DRMDevice2* iface,
141                                                                         D3DRMOBJECTCALLBACK cb,
142                                                                         LPVOID argument)
143 {
144     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
145
146     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
147
148     return E_NOTIMPL;
149 }
150
151 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetAppData(IDirect3DRMDevice2* iface,
152                                                              DWORD data)
153 {
154     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
155
156     FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
157
158     return E_NOTIMPL;
159 }
160
161 static DWORD WINAPI IDirect3DRMDevice2Impl_GetAppData(IDirect3DRMDevice2* iface)
162 {
163     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
164
165     FIXME("(%p/%p)->(): stub\n", iface, This);
166
167     return 0;
168 }
169
170 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetName(IDirect3DRMDevice2* iface, LPCSTR name)
171 {
172     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
173
174     FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
175
176     return E_NOTIMPL;
177 }
178
179 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetName(IDirect3DRMDevice2* iface,
180                                                           LPDWORD size, LPSTR name)
181 {
182     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
183
184     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
185
186     return E_NOTIMPL;
187 }
188
189 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetClassName(IDirect3DRMDevice2* iface,
190                                                                LPDWORD size, LPSTR name)
191 {
192     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
193
194     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
195
196     return E_NOTIMPL;
197 }
198
199 /*** IDirect3DRMDevice methods ***/
200 static HRESULT WINAPI IDirect3DRMDevice2Impl_Init(IDirect3DRMDevice2* iface, ULONG width,
201                                                   ULONG height)
202 {
203     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
204
205     FIXME("(%p/%p)->(%u, %u): stub\n", iface, This, width, height);
206
207     return E_NOTIMPL;
208 }
209
210 /*** IDirect3DRMDevice2 methods ***/
211 static HRESULT WINAPI IDirect3DRMDevice2Impl_InitFromD3D(IDirect3DRMDevice2* iface,
212                                                          LPDIRECT3D lpD3D,
213                                                          LPDIRECT3DDEVICE lpD3DDev)
214 {
215     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
216
217     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, lpD3D, lpD3DDev);
218
219     return E_NOTIMPL;
220 }
221
222 static HRESULT WINAPI IDirect3DRMDevice2Impl_InitFromClipper(IDirect3DRMDevice2* iface,
223                                                              LPDIRECTDRAWCLIPPER lpDDClipper,
224                                                              LPGUID lpGUID, int width, int height)
225 {
226     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
227
228     FIXME("(%p/%p)->(%p, %p, %u, %u): stub\n", iface, This, lpDDClipper, lpGUID, width, height);
229
230     return E_NOTIMPL;
231 }
232
233 static HRESULT WINAPI IDirect3DRMDevice2Impl_Update(IDirect3DRMDevice2* iface)
234 {
235     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
236
237     FIXME("(%p/%p)->(): stub\n", iface, This);
238
239     return E_NOTIMPL;
240 }
241
242 static HRESULT WINAPI IDirect3DRMDevice2Impl_AddUpdateCallback(IDirect3DRMDevice2* iface,
243                                                                D3DRMUPDATECALLBACK cb, LPVOID arg)
244 {
245     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
246
247     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, arg);
248
249     return E_NOTIMPL;
250 }
251
252 static HRESULT WINAPI IDirect3DRMDevice2Impl_DeleteUpdateCallback(IDirect3DRMDevice2* iface,
253                                                                   D3DRMUPDATECALLBACK cb,
254                                                                   LPVOID arg)
255 {
256     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
257
258     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, arg);
259
260     return E_NOTIMPL;
261 }
262
263 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetBufferCount(IDirect3DRMDevice2* iface, DWORD count)
264 {
265     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
266
267     FIXME("(%p/%p)->(%u): stub\n", iface, This, count);
268
269     return E_NOTIMPL;
270 }
271
272 static DWORD WINAPI IDirect3DRMDevice2Impl_GetBufferCount(IDirect3DRMDevice2* iface)
273 {
274     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
275
276     FIXME("(%p/%p)->(): stub\n", iface, This);
277
278     return E_NOTIMPL;
279 }
280
281 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetDither(IDirect3DRMDevice2* iface, BOOL enable)
282 {
283     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
284
285     TRACE("(%p/%p)->(%d)\n", iface, This, enable);
286
287     return IDirect3DRMDevice3_SetDither(&This->IDirect3DRMDevice3_iface, enable);
288 }
289
290 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetShades(IDirect3DRMDevice2* iface, DWORD count)
291 {
292     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
293
294     FIXME("(%p/%p)->(%u): stub\n", iface, This, count);
295
296     return E_NOTIMPL;
297 }
298
299 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetQuality(IDirect3DRMDevice2* iface,
300                                                         D3DRMRENDERQUALITY quality)
301 {
302     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
303
304     FIXME("(%p/%p)->(%u): stub\n", iface, This, quality);
305
306     return E_NOTIMPL;
307 }
308
309 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetTextureQuality(IDirect3DRMDevice2* iface,
310                                                                D3DRMTEXTUREQUALITY quality)
311 {
312     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
313
314     FIXME("(%p/%p)->(%u): stub\n", iface, This, quality);
315
316     return E_NOTIMPL;
317 }
318
319 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetViewports(IDirect3DRMDevice2* iface,
320                                                           LPDIRECT3DRMVIEWPORTARRAY *return_views)
321 {
322     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
323
324     FIXME("(%p/%p)->(%p): stub\n", iface, This, return_views);
325
326     return E_NOTIMPL;
327 }
328
329 static BOOL WINAPI IDirect3DRMDevice2Impl_GetDither(IDirect3DRMDevice2* iface)
330 {
331     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
332
333     TRACE("(%p/%p)->()\n", iface, This);
334
335     return IDirect3DRMDevice3_GetDither(&This->IDirect3DRMDevice3_iface);
336 }
337
338 static DWORD WINAPI IDirect3DRMDevice2Impl_GetShades(IDirect3DRMDevice2* iface)
339 {
340     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
341
342     FIXME("(%p/%p)->(): stub\n", iface, This);
343
344     return E_NOTIMPL;
345 }
346
347 static DWORD WINAPI IDirect3DRMDevice2Impl_GetHeight(IDirect3DRMDevice2* iface)
348 {
349     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
350
351     FIXME("(%p/%p)->(): stub\n", iface, This);
352
353     return E_NOTIMPL;
354 }
355
356 static DWORD WINAPI IDirect3DRMDevice2Impl_GetWidth(IDirect3DRMDevice2* iface)
357 {
358     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
359
360     FIXME("(%p/%p)->(): stub\n", iface, This);
361
362     return E_NOTIMPL;
363 }
364
365 static DWORD WINAPI IDirect3DRMDevice2Impl_GetTrianglesDrawn(IDirect3DRMDevice2* iface)
366 {
367     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
368
369     FIXME("(%p/%p)->(): stub\n", iface, This);
370
371     return E_NOTIMPL;
372 }
373
374 static DWORD WINAPI IDirect3DRMDevice2Impl_GetWireframeOptions(IDirect3DRMDevice2* iface)
375 {
376     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
377
378     FIXME("(%p/%p)->(): stub\n", iface, This);
379
380     return E_NOTIMPL;
381 }
382
383 static D3DRMRENDERQUALITY WINAPI IDirect3DRMDevice2Impl_GetQuality(IDirect3DRMDevice2* iface)
384 {
385     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
386
387     FIXME("(%p/%p)->(): stub\n", iface, This);
388
389     return E_NOTIMPL;
390 }
391
392 static D3DCOLORMODEL WINAPI IDirect3DRMDevice2Impl_GetColorModel(IDirect3DRMDevice2* iface)
393 {
394     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
395
396     FIXME("(%p/%p)->(): stub\n", iface, This);
397
398     return E_NOTIMPL;
399 }
400
401 static D3DRMTEXTUREQUALITY WINAPI IDirect3DRMDevice2Impl_GetTextureQuality(IDirect3DRMDevice2* iface)
402 {
403     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
404
405     FIXME("(%p/%p)->(): stub\n", iface, This);
406
407     return E_NOTIMPL;
408 }
409
410 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetDirect3DDevice(IDirect3DRMDevice2* iface,
411                                                                LPDIRECT3DDEVICE * dev)
412 {
413     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
414
415     FIXME("(%p/%p)->(%p): stub\n", iface, This, dev);
416
417     return E_NOTIMPL;
418 }
419
420 static HRESULT WINAPI IDirect3DRMDevice2Impl_InitFromD3D2(IDirect3DRMDevice2* iface,
421                                                           LPDIRECT3D2 lpD3D,
422                                                           LPDIRECT3DDEVICE2 lpD3DDev)
423 {
424     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
425
426     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, lpD3D, lpD3DDev);
427
428     return E_NOTIMPL;
429 }
430
431 static HRESULT WINAPI IDirect3DRMDevice2Impl_InitFromSurface(IDirect3DRMDevice2* iface,
432                                                              LPGUID lpGUID, LPDIRECTDRAW lpDD,
433                                                              LPDIRECTDRAWSURFACE lpDDSBack)
434 {
435     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
436
437     FIXME("(%p/%p)->(%p, %p, %p): stub\n", iface, This, lpGUID, lpDD, lpDDSBack);
438
439     return E_NOTIMPL;
440 }
441
442 static HRESULT WINAPI IDirect3DRMDevice2Impl_SetRenderMode(IDirect3DRMDevice2* iface, DWORD dwFlags)
443 {
444     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
445
446     FIXME("(%p/%p)->(%u): stub\n", iface, This, dwFlags);
447
448     return E_NOTIMPL;
449 }
450
451 static DWORD WINAPI IDirect3DRMDevice2Impl_GetRenderMode(IDirect3DRMDevice2* iface)
452 {
453     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
454
455     FIXME("(%p/%p)->(): stub\n", iface, This);
456
457     return E_NOTIMPL;
458 }
459
460 static HRESULT WINAPI IDirect3DRMDevice2Impl_GetDirect3DDevice2(IDirect3DRMDevice2* iface,
461                                                                 LPDIRECT3DDEVICE2 * dev)
462 {
463     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice2(iface);
464
465     FIXME("(%p/%p)->(%p): stub\n", iface, This, dev);
466
467     return E_NOTIMPL;
468 }
469
470 static const struct IDirect3DRMDevice2Vtbl Direct3DRMDevice2_Vtbl =
471 {
472     /*** IUnknown methods ***/
473     IDirect3DRMDevice2Impl_QueryInterface,
474     IDirect3DRMDevice2Impl_AddRef,
475     IDirect3DRMDevice2Impl_Release,
476     /*** IDirect3DRMObject methods ***/
477     IDirect3DRMDevice2Impl_Clone,
478     IDirect3DRMDevice2Impl_AddDestroyCallback,
479     IDirect3DRMDevice2Impl_DeleteDestroyCallback,
480     IDirect3DRMDevice2Impl_SetAppData,
481     IDirect3DRMDevice2Impl_GetAppData,
482     IDirect3DRMDevice2Impl_SetName,
483     IDirect3DRMDevice2Impl_GetName,
484     IDirect3DRMDevice2Impl_GetClassName,
485     /*** IDirect3DRMDevice methods ***/
486     IDirect3DRMDevice2Impl_Init,
487     IDirect3DRMDevice2Impl_InitFromD3D,
488     IDirect3DRMDevice2Impl_InitFromClipper,
489     IDirect3DRMDevice2Impl_Update,
490     IDirect3DRMDevice2Impl_AddUpdateCallback,
491     IDirect3DRMDevice2Impl_DeleteUpdateCallback,
492     IDirect3DRMDevice2Impl_SetBufferCount,
493     IDirect3DRMDevice2Impl_GetBufferCount,
494     IDirect3DRMDevice2Impl_SetDither,
495     IDirect3DRMDevice2Impl_SetShades,
496     IDirect3DRMDevice2Impl_SetQuality,
497     IDirect3DRMDevice2Impl_SetTextureQuality,
498     IDirect3DRMDevice2Impl_GetViewports,
499     IDirect3DRMDevice2Impl_GetDither,
500     IDirect3DRMDevice2Impl_GetShades,
501     IDirect3DRMDevice2Impl_GetHeight,
502     IDirect3DRMDevice2Impl_GetWidth,
503     IDirect3DRMDevice2Impl_GetTrianglesDrawn,
504     IDirect3DRMDevice2Impl_GetWireframeOptions,
505     IDirect3DRMDevice2Impl_GetQuality,
506     IDirect3DRMDevice2Impl_GetColorModel,
507     IDirect3DRMDevice2Impl_GetTextureQuality,
508     IDirect3DRMDevice2Impl_GetDirect3DDevice,
509     /*** IDirect3DRMDevice2 methods ***/
510     IDirect3DRMDevice2Impl_InitFromD3D2,
511     IDirect3DRMDevice2Impl_InitFromSurface,
512     IDirect3DRMDevice2Impl_SetRenderMode,
513     IDirect3DRMDevice2Impl_GetRenderMode,
514     IDirect3DRMDevice2Impl_GetDirect3DDevice2
515 };
516
517
518 /*** IUnknown methods ***/
519 static HRESULT WINAPI IDirect3DRMDevice3Impl_QueryInterface(IDirect3DRMDevice3* iface,
520                                                             REFIID riid, void** object)
521 {
522     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
523     return IDirect3DRMDevice2_QueryInterface(&This->IDirect3DRMDevice2_iface, riid, object);
524 }
525
526 static ULONG WINAPI IDirect3DRMDevice3Impl_AddRef(IDirect3DRMDevice3* iface)
527 {
528     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
529     return IDirect3DRMDevice2_AddRef(&This->IDirect3DRMDevice2_iface);
530 }
531
532 static ULONG WINAPI IDirect3DRMDevice3Impl_Release(IDirect3DRMDevice3* iface)
533 {
534     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
535     return IDirect3DRMDevice2_Release(&This->IDirect3DRMDevice2_iface);
536 }
537
538 /*** IDirect3DRMObject methods ***/
539 static HRESULT WINAPI IDirect3DRMDevice3Impl_Clone(IDirect3DRMDevice3* iface,
540                                                         LPUNKNOWN unkwn, REFIID riid,
541                                                         LPVOID* object)
542 {
543     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
544
545     FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
546
547     return E_NOTIMPL;
548 }
549
550 static HRESULT WINAPI IDirect3DRMDevice3Impl_AddDestroyCallback(IDirect3DRMDevice3* iface,
551                                                                      D3DRMOBJECTCALLBACK cb,
552                                                                      LPVOID argument)
553 {
554     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
555
556     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
557
558     return E_NOTIMPL;
559 }
560
561 static HRESULT WINAPI IDirect3DRMDevice3Impl_DeleteDestroyCallback(IDirect3DRMDevice3* iface,
562                                                                         D3DRMOBJECTCALLBACK cb,
563                                                                         LPVOID argument)
564 {
565     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
566
567     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
568
569     return E_NOTIMPL;
570 }
571
572 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetAppData(IDirect3DRMDevice3* iface,
573                                                              DWORD data)
574 {
575     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
576
577     FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
578
579     return E_NOTIMPL;
580 }
581
582 static DWORD WINAPI IDirect3DRMDevice3Impl_GetAppData(IDirect3DRMDevice3* iface)
583 {
584     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
585
586     FIXME("(%p/%p)->(): stub\n", iface, This);
587
588     return 0;
589 }
590
591 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetName(IDirect3DRMDevice3* iface, LPCSTR name)
592 {
593     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
594
595     FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
596
597     return E_NOTIMPL;
598 }
599
600 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetName(IDirect3DRMDevice3* iface,
601                                                           LPDWORD size, LPSTR name)
602 {
603     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
604
605     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
606
607     return E_NOTIMPL;
608 }
609
610 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetClassName(IDirect3DRMDevice3* iface,
611                                                                LPDWORD size, LPSTR name)
612 {
613     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
614
615     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
616
617     return E_NOTIMPL;
618 }
619
620 /*** IDirect3DRMDevice methods ***/
621 static HRESULT WINAPI IDirect3DRMDevice3Impl_Init(IDirect3DRMDevice3* iface, ULONG width,
622                                                   ULONG height)
623 {
624     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
625
626     FIXME("(%p/%p)->(%u, %u): stub\n", iface, This, width, height);
627
628     return E_NOTIMPL;
629 }
630
631 static HRESULT WINAPI IDirect3DRMDevice3Impl_InitFromD3D(IDirect3DRMDevice3* iface,
632                                                          LPDIRECT3D lpD3D,
633                                                          LPDIRECT3DDEVICE lpD3DDev)
634 {
635     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
636
637     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, lpD3D, lpD3DDev);
638
639     return E_NOTIMPL;
640 }
641
642 static HRESULT WINAPI IDirect3DRMDevice3Impl_InitFromClipper(IDirect3DRMDevice3* iface,
643                                                              LPDIRECTDRAWCLIPPER lpDDClipper,
644                                                              LPGUID lpGUID, int width, int height)
645 {
646     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
647
648     FIXME("(%p/%p)->(%p, %p, %u, %u): stub\n", iface, This, lpDDClipper, lpGUID, width, height);
649
650     return E_NOTIMPL;
651 }
652
653 static HRESULT WINAPI IDirect3DRMDevice3Impl_Update(IDirect3DRMDevice3* iface)
654 {
655     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
656
657     FIXME("(%p/%p)->(): stub\n", iface, This);
658
659     return E_NOTIMPL;
660 }
661
662 static HRESULT WINAPI IDirect3DRMDevice3Impl_AddUpdateCallback(IDirect3DRMDevice3* iface,
663                                                                D3DRMUPDATECALLBACK cb, LPVOID arg)
664 {
665     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
666
667     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, arg);
668
669     return E_NOTIMPL;
670 }
671
672 static HRESULT WINAPI IDirect3DRMDevice3Impl_DeleteUpdateCallback(IDirect3DRMDevice3* iface,
673                                                                   D3DRMUPDATECALLBACK cb,
674                                                                   LPVOID arg)
675 {
676     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
677
678     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, arg);
679
680     return E_NOTIMPL;
681 }
682
683 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetBufferCount(IDirect3DRMDevice3* iface, DWORD count)
684 {
685     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
686
687     FIXME("(%p/%p)->(%u): stub\n", iface, This, count);
688
689     return E_NOTIMPL;
690 }
691
692 static DWORD WINAPI IDirect3DRMDevice3Impl_GetBufferCount(IDirect3DRMDevice3* iface)
693 {
694     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
695
696     FIXME("(%p/%p)->(): stub\n", iface, This);
697
698     return E_NOTIMPL;
699 }
700
701 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetDither(IDirect3DRMDevice3* iface, BOOL enable)
702 {
703     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
704
705     TRACE("(%p/%p)->(%d)\n", iface, This, enable);
706
707     This->dither = enable;
708
709     return D3DRM_OK;
710 }
711
712 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetShades(IDirect3DRMDevice3* iface, DWORD count)
713 {
714     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
715
716     FIXME("(%p/%p)->(%u): stub\n", iface, This, count);
717
718     return E_NOTIMPL;
719 }
720
721 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetQuality(IDirect3DRMDevice3* iface,
722                                                         D3DRMRENDERQUALITY quality)
723 {
724     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
725
726     FIXME("(%p/%p)->(%u): stub\n", iface, This, quality);
727
728     return E_NOTIMPL;
729 }
730
731 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetTextureQuality(IDirect3DRMDevice3* iface,
732                                                                D3DRMTEXTUREQUALITY quality)
733 {
734     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
735
736     FIXME("(%p/%p)->(%u): stub\n", iface, This, quality);
737
738     return E_NOTIMPL;
739 }
740
741 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetViewports(IDirect3DRMDevice3* iface,
742                                                           LPDIRECT3DRMVIEWPORTARRAY *return_views)
743 {
744     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
745
746     FIXME("(%p/%p)->(%p): stub\n", iface, This, return_views);
747
748     return E_NOTIMPL;
749 }
750
751 static BOOL WINAPI IDirect3DRMDevice3Impl_GetDither(IDirect3DRMDevice3* iface)
752 {
753     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
754
755     TRACE("(%p/%p)->()\n", iface, This);
756
757     return This->dither;
758 }
759
760 static DWORD WINAPI IDirect3DRMDevice3Impl_GetShades(IDirect3DRMDevice3* iface)
761 {
762     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
763
764     FIXME("(%p/%p)->(): stub\n", iface, This);
765
766     return E_NOTIMPL;
767 }
768
769 static DWORD WINAPI IDirect3DRMDevice3Impl_GetHeight(IDirect3DRMDevice3* iface)
770 {
771     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
772
773     FIXME("(%p/%p)->(): stub\n", iface, This);
774
775     return E_NOTIMPL;
776 }
777
778 static DWORD WINAPI IDirect3DRMDevice3Impl_GetWidth(IDirect3DRMDevice3* iface)
779 {
780     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
781
782     FIXME("(%p/%p)->(): stub\n", iface, This);
783
784     return E_NOTIMPL;
785 }
786
787 static DWORD WINAPI IDirect3DRMDevice3Impl_GetTrianglesDrawn(IDirect3DRMDevice3* iface)
788 {
789     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
790
791     FIXME("(%p/%p)->(): stub\n", iface, This);
792
793     return E_NOTIMPL;
794 }
795
796 static DWORD WINAPI IDirect3DRMDevice3Impl_GetWireframeOptions(IDirect3DRMDevice3* iface)
797 {
798     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
799
800     FIXME("(%p/%p)->(): stub\n", iface, This);
801
802     return E_NOTIMPL;
803 }
804
805 static D3DRMRENDERQUALITY WINAPI IDirect3DRMDevice3Impl_GetQuality(IDirect3DRMDevice3* iface)
806 {
807     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
808
809     FIXME("(%p/%p)->(): stub\n", iface, This);
810
811     return E_NOTIMPL;
812 }
813
814 static D3DCOLORMODEL WINAPI IDirect3DRMDevice3Impl_GetColorModel(IDirect3DRMDevice3* iface)
815 {
816     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
817
818     FIXME("(%p/%p)->(): stub\n", iface, This);
819
820     return E_NOTIMPL;
821 }
822
823 static D3DRMTEXTUREQUALITY WINAPI IDirect3DRMDevice3Impl_GetTextureQuality(IDirect3DRMDevice3* iface)
824 {
825     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
826
827     FIXME("(%p/%p)->(): stub\n", iface, This);
828
829     return E_NOTIMPL;
830 }
831
832 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetDirect3DDevice(IDirect3DRMDevice3* iface,
833                                                                LPDIRECT3DDEVICE * dev)
834 {
835     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
836
837     FIXME("(%p/%p)->(%p): stub\n", iface, This, dev);
838
839     return E_NOTIMPL;
840 }
841
842 /*** IDirect3DRMDevice2 methods ***/
843 static HRESULT WINAPI IDirect3DRMDevice3Impl_InitFromD3D2(IDirect3DRMDevice3* iface,
844                                                           LPDIRECT3D2 lpD3D,
845                                                           LPDIRECT3DDEVICE2 lpD3DDev)
846 {
847     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
848
849     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, lpD3D, lpD3DDev);
850
851     return E_NOTIMPL;
852 }
853
854 static HRESULT WINAPI IDirect3DRMDevice3Impl_InitFromSurface(IDirect3DRMDevice3* iface,
855                                                              LPGUID lpGUID, LPDIRECTDRAW lpDD,
856                                                              LPDIRECTDRAWSURFACE lpDDSBack)
857 {
858     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
859
860     FIXME("(%p/%p)->(%p, %p, %p): stub\n", iface, This, lpGUID, lpDD, lpDDSBack);
861
862     return E_NOTIMPL;
863 }
864
865 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetRenderMode(IDirect3DRMDevice3* iface, DWORD dwFlags)
866 {
867     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
868
869     FIXME("(%p/%p)->(%u): stub\n", iface, This, dwFlags);
870
871     return E_NOTIMPL;
872 }
873
874 static DWORD WINAPI IDirect3DRMDevice3Impl_GetRenderMode(IDirect3DRMDevice3* iface)
875 {
876     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
877
878     FIXME("(%p/%p)->(): stub\n", iface, This);
879
880     return E_NOTIMPL;
881 }
882
883 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetDirect3DDevice2(IDirect3DRMDevice3* iface,
884                                                                 LPDIRECT3DDEVICE2 * dev)
885 {
886     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
887
888     FIXME("(%p/%p)->(%p): stub\n", iface, This, dev);
889
890     return E_NOTIMPL;
891 }
892
893 /*** IDirect3DRMDevice3 methods ***/
894 static HRESULT WINAPI IDirect3DRMDevice3Impl_FindPreferredTextureFormat(IDirect3DRMDevice3* iface,
895                                                                         DWORD bitdepths,
896                                                                         DWORD flags,
897                                                                         LPDDPIXELFORMAT lpDDPF)
898 {
899     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
900
901     FIXME("(%p/%p)->(%u, %u, %p): stub\n", iface, This, bitdepths, flags, lpDDPF);
902
903     return E_NOTIMPL;
904 }
905
906 static HRESULT WINAPI IDirect3DRMDevice3Impl_RenderStateChange(IDirect3DRMDevice3* iface,
907                                                                D3DRENDERSTATETYPE type, DWORD val,
908                                                                DWORD flags)
909 {
910     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
911
912     FIXME("(%p/%p)->(%u, %u, %u): stub\n", iface, This, type, val, flags);
913
914     return E_NOTIMPL;
915 }
916
917 static HRESULT WINAPI IDirect3DRMDevice3Impl_LightStateChange(IDirect3DRMDevice3* iface,
918                                                               D3DLIGHTSTATETYPE type, DWORD val,
919                                                               DWORD flags)
920 {
921     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
922
923     FIXME("(%p/%p)->(%u, %u, %u): stub\n", iface, This, type, val, flags);
924
925     return E_NOTIMPL;
926 }
927
928 static HRESULT WINAPI IDirect3DRMDevice3Impl_GetStateChangeOptions(IDirect3DRMDevice3* iface,
929                                                                    DWORD stateclass, DWORD statenum,
930                                                                    LPDWORD flags)
931 {
932     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
933
934     FIXME("(%p/%p)->(%u, %u, %p): stub\n", iface, This, stateclass, statenum, flags);
935
936     return E_NOTIMPL;
937 }
938
939 static HRESULT WINAPI IDirect3DRMDevice3Impl_SetStateChangeOptions(IDirect3DRMDevice3* iface,
940                                                                    DWORD stateclass, DWORD statenum,
941                                                                    DWORD flags)
942 {
943     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMDevice3(iface);
944
945     FIXME("(%p/%p)->(%u, %u, %u): stub\n", iface, This, stateclass, statenum, flags);
946
947     return E_NOTIMPL;
948 }
949
950 static const struct IDirect3DRMDevice3Vtbl Direct3DRMDevice3_Vtbl =
951 {
952     /*** IUnknown methods ***/
953     IDirect3DRMDevice3Impl_QueryInterface,
954     IDirect3DRMDevice3Impl_AddRef,
955     IDirect3DRMDevice3Impl_Release,
956     /*** IDirect3DRMObject methods ***/
957     IDirect3DRMDevice3Impl_Clone,
958     IDirect3DRMDevice3Impl_AddDestroyCallback,
959     IDirect3DRMDevice3Impl_DeleteDestroyCallback,
960     IDirect3DRMDevice3Impl_SetAppData,
961     IDirect3DRMDevice3Impl_GetAppData,
962     IDirect3DRMDevice3Impl_SetName,
963     IDirect3DRMDevice3Impl_GetName,
964     IDirect3DRMDevice3Impl_GetClassName,
965     /*** IDirect3DRMDevice methods ***/
966     IDirect3DRMDevice3Impl_Init,
967     IDirect3DRMDevice3Impl_InitFromD3D,
968     IDirect3DRMDevice3Impl_InitFromClipper,
969     IDirect3DRMDevice3Impl_Update,
970     IDirect3DRMDevice3Impl_AddUpdateCallback,
971     IDirect3DRMDevice3Impl_DeleteUpdateCallback,
972     IDirect3DRMDevice3Impl_SetBufferCount,
973     IDirect3DRMDevice3Impl_GetBufferCount,
974     IDirect3DRMDevice3Impl_SetDither,
975     IDirect3DRMDevice3Impl_SetShades,
976     IDirect3DRMDevice3Impl_SetQuality,
977     IDirect3DRMDevice3Impl_SetTextureQuality,
978     IDirect3DRMDevice3Impl_GetViewports,
979     IDirect3DRMDevice3Impl_GetDither,
980     IDirect3DRMDevice3Impl_GetShades,
981     IDirect3DRMDevice3Impl_GetHeight,
982     IDirect3DRMDevice3Impl_GetWidth,
983     IDirect3DRMDevice3Impl_GetTrianglesDrawn,
984     IDirect3DRMDevice3Impl_GetWireframeOptions,
985     IDirect3DRMDevice3Impl_GetQuality,
986     IDirect3DRMDevice3Impl_GetColorModel,
987     IDirect3DRMDevice3Impl_GetTextureQuality,
988     IDirect3DRMDevice3Impl_GetDirect3DDevice,
989     /*** IDirect3DRMDevice2 methods ***/
990     IDirect3DRMDevice3Impl_InitFromD3D2,
991     IDirect3DRMDevice3Impl_InitFromSurface,
992     IDirect3DRMDevice3Impl_SetRenderMode,
993     IDirect3DRMDevice3Impl_GetRenderMode,
994     IDirect3DRMDevice3Impl_GetDirect3DDevice2,
995     /*** IDirect3DRMDevice3 methods ***/
996     IDirect3DRMDevice3Impl_FindPreferredTextureFormat,
997     IDirect3DRMDevice3Impl_RenderStateChange,
998     IDirect3DRMDevice3Impl_LightStateChange,
999     IDirect3DRMDevice3Impl_GetStateChangeOptions,
1000     IDirect3DRMDevice3Impl_SetStateChangeOptions
1001 };
1002
1003
1004 /*** IUnknown methods ***/
1005 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_QueryInterface(IDirect3DRMWinDevice* iface,
1006                                                               REFIID riid, void** object)
1007 {
1008     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1009     return IDirect3DRMDevice2_QueryInterface(&This->IDirect3DRMDevice2_iface, riid, object);
1010 }
1011
1012 static ULONG WINAPI IDirect3DRMWinDeviceImpl_AddRef(IDirect3DRMWinDevice* iface)
1013 {
1014     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1015     return IDirect3DRMDevice2_AddRef(&This->IDirect3DRMDevice2_iface);
1016 }
1017
1018 static ULONG WINAPI IDirect3DRMWinDeviceImpl_Release(IDirect3DRMWinDevice* iface)
1019 {
1020     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1021     return IDirect3DRMDevice2_Release(&This->IDirect3DRMDevice2_iface);
1022 }
1023
1024 /*** IDirect3DRMObject methods ***/
1025 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_Clone(IDirect3DRMWinDevice* iface,
1026                                                         LPUNKNOWN unkwn, REFIID riid,
1027                                                         LPVOID* object)
1028 {
1029     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1030
1031     FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
1032
1033     return E_NOTIMPL;
1034 }
1035
1036 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_AddDestroyCallback(IDirect3DRMWinDevice* iface,
1037                                                                      D3DRMOBJECTCALLBACK cb,
1038                                                                      LPVOID argument)
1039 {
1040     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1041
1042     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
1043
1044     return E_NOTIMPL;
1045 }
1046
1047 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_DeleteDestroyCallback(IDirect3DRMWinDevice* iface,
1048                                                                         D3DRMOBJECTCALLBACK cb,
1049                                                                         LPVOID argument)
1050 {
1051     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1052
1053     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
1054
1055     return E_NOTIMPL;
1056 }
1057
1058 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_SetAppData(IDirect3DRMWinDevice* iface,
1059                                                              DWORD data)
1060 {
1061     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1062
1063     FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
1064
1065     return E_NOTIMPL;
1066 }
1067
1068 static DWORD WINAPI IDirect3DRMWinDeviceImpl_GetAppData(IDirect3DRMWinDevice* iface)
1069 {
1070     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1071
1072     FIXME("(%p/%p)->(): stub\n", iface, This);
1073
1074     return 0;
1075 }
1076
1077 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_SetName(IDirect3DRMWinDevice* iface, LPCSTR name)
1078 {
1079     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1080
1081     FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
1082
1083     return E_NOTIMPL;
1084 }
1085
1086 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_GetName(IDirect3DRMWinDevice* iface,
1087                                                           LPDWORD size, LPSTR name)
1088 {
1089     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1090
1091     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
1092
1093     return E_NOTIMPL;
1094 }
1095
1096 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_GetClassName(IDirect3DRMWinDevice* iface,
1097                                                                LPDWORD size, LPSTR name)
1098 {
1099     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1100
1101     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
1102
1103     return E_NOTIMPL;
1104 }
1105
1106 /*** IDirect3DRMWinDevice methods ***/
1107 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_HandlePaint(IDirect3DRMWinDevice* iface, HDC hdc)
1108 {
1109     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1110
1111     FIXME("(%p/%p)->(%p): stub\n", iface, This, hdc);
1112
1113     return E_NOTIMPL;
1114 }
1115
1116 static HRESULT WINAPI IDirect3DRMWinDeviceImpl_HandleActivate(IDirect3DRMWinDevice* iface, WORD wparam)
1117 {
1118     IDirect3DRMDeviceImpl *This = impl_from_IDirect3DRMWinDevice(iface);
1119
1120     FIXME("(%p/%p)->(%u): stub\n", iface, This, wparam);
1121
1122     return E_NOTIMPL;
1123 }
1124
1125 static const struct IDirect3DRMWinDeviceVtbl Direct3DRMWinDevice_Vtbl =
1126 {
1127     /*** IUnknown methods ***/
1128     IDirect3DRMWinDeviceImpl_QueryInterface,
1129     IDirect3DRMWinDeviceImpl_AddRef,
1130     IDirect3DRMWinDeviceImpl_Release,
1131     /*** IDirect3DRMObject methods ***/
1132     IDirect3DRMWinDeviceImpl_Clone,
1133     IDirect3DRMWinDeviceImpl_AddDestroyCallback,
1134     IDirect3DRMWinDeviceImpl_DeleteDestroyCallback,
1135     IDirect3DRMWinDeviceImpl_SetAppData,
1136     IDirect3DRMWinDeviceImpl_GetAppData,
1137     IDirect3DRMWinDeviceImpl_SetName,
1138     IDirect3DRMWinDeviceImpl_GetName,
1139     IDirect3DRMWinDeviceImpl_GetClassName,
1140     /*** IDirect3DRMWinDevice methods ***/
1141     IDirect3DRMWinDeviceImpl_HandlePaint,
1142     IDirect3DRMWinDeviceImpl_HandleActivate
1143 };
1144
1145 HRESULT Direct3DRMDevice_create(REFIID riid, IUnknown** ppObj)
1146 {
1147     IDirect3DRMDeviceImpl* object;
1148
1149     TRACE("(%p)\n", ppObj);
1150
1151     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMDeviceImpl));
1152     if (!object)
1153     {
1154         ERR("Out of memory\n");
1155         return E_OUTOFMEMORY;
1156     }
1157
1158     object->IDirect3DRMDevice2_iface.lpVtbl = &Direct3DRMDevice2_Vtbl;
1159     object->IDirect3DRMDevice3_iface.lpVtbl = &Direct3DRMDevice3_Vtbl;
1160     object->IDirect3DRMWinDevice_iface.lpVtbl = &Direct3DRMWinDevice_Vtbl;
1161     object->ref = 1;
1162
1163     if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
1164         *ppObj = (IUnknown*)&object->IDirect3DRMDevice3_iface;
1165     else
1166         *ppObj = (IUnknown*)&object->IDirect3DRMDevice2_iface;
1167
1168     return S_OK;
1169 }