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