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