d3drm: Fix leakage of pData2 on error.
[wine] / dlls / d3drm / d3drm.c
1 /*
2  * Implementation of IDirect3DRM Interface
3  *
4  * Copyright 2010 Christian Costa
5  * Copyright 2011 AndrĂ© Hentschel
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 #include "wine/debug.h"
23
24 #define COBJMACROS
25
26 #include "winbase.h"
27 #include "wingdi.h"
28
29 #include "d3drm_private.h"
30
31 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
32
33 typedef struct {
34     IDirect3DRM IDirect3DRM_iface;
35     IDirect3DRM2 IDirect3DRM2_iface;
36     IDirect3DRM3 IDirect3DRM3_iface;
37     LONG ref;
38 } IDirect3DRMImpl;
39
40 static inline IDirect3DRMImpl *impl_from_IDirect3DRM(IDirect3DRM *iface)
41 {
42     return CONTAINING_RECORD(iface, IDirect3DRMImpl, IDirect3DRM_iface);
43 }
44
45 static inline IDirect3DRMImpl *impl_from_IDirect3DRM2(IDirect3DRM2 *iface)
46 {
47     return CONTAINING_RECORD(iface, IDirect3DRMImpl, IDirect3DRM2_iface);
48 }
49
50 static inline IDirect3DRMImpl *impl_from_IDirect3DRM3(IDirect3DRM3 *iface)
51 {
52     return CONTAINING_RECORD(iface, IDirect3DRMImpl, IDirect3DRM3_iface);
53 }
54
55 /*** IUnknown methods ***/
56 static HRESULT WINAPI IDirect3DRMImpl_QueryInterface(IDirect3DRM* iface, REFIID riid, void** ppvObject)
57 {
58     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
59
60     TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
61
62     *ppvObject = NULL;
63
64     if(IsEqualGUID(riid, &IID_IUnknown) ||
65        IsEqualGUID(riid, &IID_IDirect3DRM))
66     {
67         *ppvObject = &This->IDirect3DRM_iface;
68     }
69     else if(IsEqualGUID(riid, &IID_IDirect3DRM2))
70     {
71         *ppvObject = &This->IDirect3DRM2_iface;
72     }
73     else if(IsEqualGUID(riid, &IID_IDirect3DRM3))
74     {
75         *ppvObject = &This->IDirect3DRM3_iface;
76     }
77     else
78     {
79         FIXME("interface %s not implemented\n", debugstr_guid(riid));
80         return E_NOINTERFACE;
81     }
82
83     IDirect3DRM_AddRef(iface);
84     return S_OK;
85 }
86
87 static ULONG WINAPI IDirect3DRMImpl_AddRef(IDirect3DRM* iface)
88 {
89     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
90
91     TRACE("(%p/%p)\n", iface, This);
92
93     return InterlockedIncrement(&This->ref);
94 }
95
96 static ULONG WINAPI IDirect3DRMImpl_Release(IDirect3DRM* iface)
97 {
98     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
99     ULONG ref = InterlockedDecrement(&This->ref);
100
101     TRACE("(%p/%p)\n", iface, This);
102
103     if (!ref)
104         HeapFree(GetProcessHeap(), 0, This);
105
106     return ref;
107 }
108
109 /*** IDirect3DRM methods ***/
110 static HRESULT WINAPI IDirect3DRMImpl_CreateObject(IDirect3DRM* iface, REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
111 {
112     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
113
114     FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter, debugstr_guid(riid), ppvObj);
115
116     return E_NOTIMPL;
117 }
118
119 static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM* iface, LPDIRECT3DRMFRAME pFrameParent, LPDIRECT3DRMFRAME * ppFrame)
120 {
121     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
122
123     TRACE("(%p/%p)->(%p,%p)\n", iface, This, pFrameParent, ppFrame);
124
125     if (pFrameParent)
126         FIXME("(%p/%p): Parent frame not yet supported\n", iface, This);
127
128     return Direct3DRMFrame_create(&IID_IDirect3DRMFrame, (IUnknown**)ppFrame);
129 }
130
131 static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM* iface, LPDIRECT3DRMMESH * ppMesh)
132 {
133     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
134
135     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
136
137     return E_NOTIMPL;
138 }
139
140 static HRESULT WINAPI IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM* iface, LPDIRECT3DRMMESHBUILDER * ppMeshBuilder)
141 {
142     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
143
144     TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
145
146     return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder, (IUnknown**)ppMeshBuilder);
147 }
148
149 static HRESULT WINAPI IDirect3DRMImpl_CreateFace(IDirect3DRM* iface, LPDIRECT3DRMFACE * ppFace)
150 {
151     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
152
153     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
154
155     return E_NOTIMPL;
156 }
157
158 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimation(IDirect3DRM* iface, LPDIRECT3DRMANIMATION * ppAnimation)
159 {
160     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
161
162     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
163
164     return E_NOTIMPL;
165 }
166
167 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM* iface, LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
168 {
169     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
170
171     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
172
173     return E_NOTIMPL;
174 }
175
176 static HRESULT WINAPI IDirect3DRMImpl_CreateTexture(IDirect3DRM* iface, LPD3DRMIMAGE pImage, LPDIRECT3DRMTEXTURE * ppTexture)
177 {
178     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
179
180     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
181
182     return E_NOTIMPL;
183 }
184
185 static HRESULT WINAPI IDirect3DRMImpl_CreateLight(IDirect3DRM* iface, D3DRMLIGHTTYPE type, D3DCOLOR color, LPDIRECT3DRMLIGHT * ppLight)
186 {
187     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
188
189     FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, type, color, ppLight);
190
191     return E_NOTIMPL;
192 }
193
194 static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM* iface, D3DRMLIGHTTYPE type,  D3DVALUE red, D3DVALUE green, D3DVALUE blue, LPDIRECT3DRMLIGHT * ppLight)
195 {
196     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
197
198     FIXME("(%p/%p)->(%d,%f,%f,%f,%p): stub\n", iface, This, type, red, green, blue, ppLight);
199
200     return E_NOTIMPL;
201 }
202
203 static HRESULT WINAPI IDirect3DRMImpl_Material(IDirect3DRM* iface, D3DVALUE m, LPDIRECT3DRMMATERIAL * ppMaterial)
204 {
205     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
206
207     FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial);
208
209     return E_NOTIMPL;
210 }
211
212 static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM* iface, DWORD width, DWORD height, LPDIRECT3DRMDEVICE * ppDevice)
213 {
214     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
215
216     FIXME("(%p/%p)->(%u,%u,%p): partial stub\n", iface, This, width, height, ppDevice);
217
218     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
219 }
220
221 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM* iface, LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack, LPDIRECT3DRMDEVICE * ppDevice)
222 {
223     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
224
225     FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), pDD,
226           pDDSBack, ppDevice);
227
228     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
229 }
230
231 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM* iface, LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev, LPDIRECT3DRMDEVICE * ppDevice)
232 {
233     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
234
235     FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
236
237     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
238 }
239
240 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM* iface, LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height, LPDIRECT3DRMDEVICE * ppDevice)
241 {
242     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
243
244     FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
245           debugstr_guid(pGUID), width, height, ppDevice);
246
247     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
248 }
249
250 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM* iface, LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE * ppTexture)
251 {
252     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
253
254     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
255
256     return E_NOTIMPL;
257 }
258
259 static HRESULT WINAPI IDirect3DRMImpl_CreateShadow(IDirect3DRM* iface, LPDIRECT3DRMVISUAL pVisual, LPDIRECT3DRMLIGHT pLight, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, LPDIRECT3DRMVISUAL * ppVisual)
260 {
261     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
262
263     FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz, nx, ny, nz, ppVisual);
264
265     return E_NOTIMPL;
266 }
267
268 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM* iface, LPDIRECT3DRMDEVICE pDevice, LPDIRECT3DRMFRAME pFrame, DWORD xpos, DWORD ypos, DWORD width, DWORD height, LPDIRECT3DRMVIEWPORT * ppViewport)
269 {
270     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
271
272     FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): partial stub\n", iface, This, pDevice, pFrame,
273           xpos, ypos, width, height, ppViewport);
274
275     return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown**)ppViewport);
276 }
277
278 static HRESULT WINAPI IDirect3DRMImpl_CreateWrap(IDirect3DRM* iface, D3DRMWRAPTYPE type, LPDIRECT3DRMFRAME pFrame, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv, LPDIRECT3DRMWRAP * ppWrap)
279 {
280     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
281
282     FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type, pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
283
284     return E_NOTIMPL;
285 }
286
287 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
288 {
289     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
290
291     FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
292
293     return E_NOTIMPL;
294 }
295
296 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
297 {
298     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
299
300     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
301
302     return E_NOTIMPL;
303 }
304
305 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
306 {
307     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
308
309     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
310
311     return E_NOTIMPL;
312 }
313
314 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(IDirect3DRM* iface, LPCSTR path)
315 {
316     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
317
318     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
319
320     return E_NOTIMPL;
321 }
322
323 static HRESULT WINAPI IDirect3DRMImpl_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
324 {
325     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
326
327     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
328
329     return E_NOTIMPL;
330 }
331
332 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
333 {
334     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
335
336     FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
337
338     return E_NOTIMPL;
339 }
340
341 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
342 {
343     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
344
345     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
346
347     return E_NOTIMPL;
348 }
349
350 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
351 {
352     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
353
354     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
355
356     return E_NOTIMPL;
357 }
358
359 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
360 {
361     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
362
363     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
364
365     return E_NOTIMPL;
366 }
367
368 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM* iface, const char * pName, LPDIRECT3DRMOBJECT * ppObject)
369 {
370     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
371
372     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
373
374     return E_NOTIMPL;
375 }
376
377 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
378 {
379     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
380
381     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
382
383     return E_NOTIMPL;
384 }
385
386 static HRESULT WINAPI IDirect3DRMImpl_Load(IDirect3DRM* iface, LPVOID pObjSource, LPVOID pObjID, LPIID * ppGUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc, LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
387 {
388     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
389
390     FIXME("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p): stub\n", iface, This, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
391
392     return E_NOTIMPL;
393 }
394
395 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
396 {
397     IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
398
399     FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
400
401     return E_NOTIMPL;
402 }
403
404 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
405 {
406     IDirect3DRMImpl_QueryInterface,
407     IDirect3DRMImpl_AddRef,
408     IDirect3DRMImpl_Release,
409     IDirect3DRMImpl_CreateObject,
410     IDirect3DRMImpl_CreateFrame,
411     IDirect3DRMImpl_CreateMesh,
412     IDirect3DRMImpl_CreateMeshBuilder,
413     IDirect3DRMImpl_CreateFace,
414     IDirect3DRMImpl_CreateAnimation,
415     IDirect3DRMImpl_CreateAnimationSet,
416     IDirect3DRMImpl_CreateTexture,
417     IDirect3DRMImpl_CreateLight,
418     IDirect3DRMImpl_CreateLightRGB,
419     IDirect3DRMImpl_Material,
420     IDirect3DRMImpl_CreateDevice,
421     IDirect3DRMImpl_CreateDeviceFromSurface,
422     IDirect3DRMImpl_CreateDeviceFromD3D,
423     IDirect3DRMImpl_CreateDeviceFromClipper,
424     IDirect3DRMImpl_CreateTextureFromSurface,
425     IDirect3DRMImpl_CreateShadow,
426     IDirect3DRMImpl_CreateViewport,
427     IDirect3DRMImpl_CreateWrap,
428     IDirect3DRMImpl_CreateUserVisual,
429     IDirect3DRMImpl_LoadTexture,
430     IDirect3DRMImpl_LoadTextureFromResource,
431     IDirect3DRMImpl_SetSearchPath,
432     IDirect3DRMImpl_AddSearchPath,
433     IDirect3DRMImpl_GetSearchPath,
434     IDirect3DRMImpl_SetDefaultTextureColors,
435     IDirect3DRMImpl_SetDefaultTextureShades,
436     IDirect3DRMImpl_GetDevices,
437     IDirect3DRMImpl_GetNamedObject,
438     IDirect3DRMImpl_EnumerateObjects,
439     IDirect3DRMImpl_Load,
440     IDirect3DRMImpl_Tick
441 };
442
443
444 /*** IUnknown methods ***/
445 static HRESULT WINAPI IDirect3DRM2Impl_QueryInterface(IDirect3DRM2* iface, REFIID riid,
446                                                       void** ppvObject)
447 {
448     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
449     return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
450 }
451
452 static ULONG WINAPI IDirect3DRM2Impl_AddRef(IDirect3DRM2* iface)
453 {
454     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
455     return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
456 }
457
458 static ULONG WINAPI IDirect3DRM2Impl_Release(IDirect3DRM2* iface)
459 {
460     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
461     return IDirect3DRM_Release(&This->IDirect3DRM_iface);
462 }
463
464 /*** IDirect3DRM2 methods ***/
465 static HRESULT WINAPI IDirect3DRM2Impl_CreateObject(IDirect3DRM2* iface, REFCLSID rclsid,
466                                                     LPUNKNOWN pUnkOuter, REFIID riid,
467                                                     LPVOID *ppvObj)
468 {
469     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
470
471     FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter,
472                                             debugstr_guid(riid), ppvObj);
473
474     return E_NOTIMPL;
475 }
476
477 static HRESULT WINAPI IDirect3DRM2Impl_CreateFrame(IDirect3DRM2* iface,
478                                                    LPDIRECT3DRMFRAME pFrameParent,
479                                                    LPDIRECT3DRMFRAME2 * ppFrame)
480 {
481     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
482
483     TRACE("(%p/%p)->(%p,%p)\n", iface, This, pFrameParent, ppFrame);
484
485     if (pFrameParent)
486         FIXME("(%p/%p): Parent frame not yet supported\n", iface, This);
487
488     return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown**)ppFrame);
489 }
490
491 static HRESULT WINAPI IDirect3DRM2Impl_CreateMesh(IDirect3DRM2* iface, LPDIRECT3DRMMESH * ppMesh)
492 {
493     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
494
495     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
496
497     return E_NOTIMPL;
498 }
499
500 static HRESULT WINAPI IDirect3DRM2Impl_CreateMeshBuilder(IDirect3DRM2* iface,
501                                                          LPDIRECT3DRMMESHBUILDER2 * ppMeshBuilder)
502 {
503     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
504
505     TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
506
507     return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder2, (IUnknown**)ppMeshBuilder);
508 }
509
510 static HRESULT WINAPI IDirect3DRM2Impl_CreateFace(IDirect3DRM2* iface, LPDIRECT3DRMFACE * ppFace)
511 {
512     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
513
514     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
515
516     return E_NOTIMPL;
517 }
518
519 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimation(IDirect3DRM2* iface,
520                                                        LPDIRECT3DRMANIMATION * ppAnimation)
521 {
522     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
523
524     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
525
526     return E_NOTIMPL;
527 }
528
529 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimationSet(IDirect3DRM2* iface,
530                                                           LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
531 {
532     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
533
534     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
535
536     return E_NOTIMPL;
537 }
538
539 static HRESULT WINAPI IDirect3DRM2Impl_CreateTexture(IDirect3DRM2* iface, LPD3DRMIMAGE pImage,
540                                                      LPDIRECT3DRMTEXTURE2 * ppTexture)
541 {
542     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
543
544     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
545
546     return E_NOTIMPL;
547 }
548
549 static HRESULT WINAPI IDirect3DRM2Impl_CreateLight(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
550                                                    D3DCOLOR color, LPDIRECT3DRMLIGHT * ppLight)
551 {
552     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
553
554     FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, type, color, ppLight);
555
556     return E_NOTIMPL;
557 }
558
559 static HRESULT WINAPI IDirect3DRM2Impl_CreateLightRGB(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
560                                                       D3DVALUE red, D3DVALUE green, D3DVALUE blue,
561                                                       LPDIRECT3DRMLIGHT * ppLight)
562 {
563     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
564
565     FIXME("(%p/%p)->(%d,%f,%f,%f,%p): stub\n", iface, This, type, red, green, blue, ppLight);
566
567     return E_NOTIMPL;
568 }
569
570 static HRESULT WINAPI IDirect3DRM2Impl_Material(IDirect3DRM2* iface, D3DVALUE m,
571                                                 LPDIRECT3DRMMATERIAL * ppMaterial)
572 {
573     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
574
575     FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial);
576
577     return E_NOTIMPL;
578 }
579
580 static HRESULT WINAPI IDirect3DRM2Impl_CreateDevice(IDirect3DRM2* iface, DWORD width, DWORD height,
581                                                     LPDIRECT3DRMDEVICE2 * ppDevice)
582 {
583     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
584
585     FIXME("(%p/%p)->(%u,%u,%p): partial stub\n", iface, This, width, height, ppDevice);
586
587     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
588 }
589
590 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromSurface(IDirect3DRM2* iface, LPGUID pGUID,
591                                                                LPDIRECTDRAW pDD,
592                                                                LPDIRECTDRAWSURFACE pDDSBack,
593                                                                LPDIRECT3DRMDEVICE2 * ppDevice)
594 {
595     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
596
597     FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID),
598           pDD, pDDSBack, ppDevice);
599
600     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
601 }
602
603 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromD3D(IDirect3DRM2* iface, LPDIRECT3D2 pD3D,
604                                                            LPDIRECT3DDEVICE2 pD3DDev,
605                                                            LPDIRECT3DRMDEVICE2 * ppDevice)
606 {
607     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
608
609     FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
610
611     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
612 }
613
614 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromClipper(IDirect3DRM2* iface,
615                                                                LPDIRECTDRAWCLIPPER pDDClipper,
616                                                                LPGUID pGUID, int width, int height,
617                                                                LPDIRECT3DRMDEVICE2 * ppDevice)
618 {
619     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
620
621     FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
622           debugstr_guid(pGUID), width, height, ppDevice);
623
624     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
625 }
626
627 static HRESULT WINAPI IDirect3DRM2Impl_CreateTextureFromSurface(IDirect3DRM2* iface,
628                                                                 LPDIRECTDRAWSURFACE pDDS,
629                                                                 LPDIRECT3DRMTEXTURE2 * ppTexture)
630 {
631     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
632
633     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
634
635     return E_NOTIMPL;
636 }
637
638 static HRESULT WINAPI IDirect3DRM2Impl_CreateShadow(IDirect3DRM2* iface, LPDIRECT3DRMVISUAL pVisual,
639                                                     LPDIRECT3DRMLIGHT pLight,
640                                                     D3DVALUE px, D3DVALUE py, D3DVALUE pz,
641                                                     D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
642                                                     LPDIRECT3DRMVISUAL * ppVisual)
643 {
644     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
645
646     FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz,
647                                                            nx, ny, nz, ppVisual);
648
649     return E_NOTIMPL;
650 }
651
652 static HRESULT WINAPI IDirect3DRM2Impl_CreateViewport(IDirect3DRM2* iface,
653                                                       LPDIRECT3DRMDEVICE pDevice,
654                                                       LPDIRECT3DRMFRAME pFrame,
655                                                       DWORD xpos, DWORD ypos,
656                                                       DWORD width, DWORD height,
657                                                       LPDIRECT3DRMVIEWPORT * ppViewport)
658 {
659     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
660
661     FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): partial stub\n", iface, This, pDevice, pFrame,
662           xpos, ypos, width, height, ppViewport);
663
664     return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown**)ppViewport);
665 }
666
667 static HRESULT WINAPI IDirect3DRM2Impl_CreateWrap(IDirect3DRM2* iface, D3DRMWRAPTYPE type,
668                                                   LPDIRECT3DRMFRAME pFrame,
669                                                   D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
670                                                   D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
671                                                   D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
672                                                   D3DVALUE ou, D3DVALUE ov, D3DVALUE su,
673                                                   D3DVALUE sv, LPDIRECT3DRMWRAP * ppWrap)
674 {
675     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
676
677     FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type,
678           pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
679
680     return E_NOTIMPL;
681 }
682
683 static HRESULT WINAPI IDirect3DRM2Impl_CreateUserVisual(IDirect3DRM2* iface,
684                                                         D3DRMUSERVISUALCALLBACK cb, LPVOID pArg,
685                                                         LPDIRECT3DRMUSERVISUAL * ppUserVisual)
686 {
687     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
688
689     FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
690
691     return E_NOTIMPL;
692 }
693
694 static HRESULT WINAPI IDirect3DRM2Impl_LoadTexture(IDirect3DRM2* iface, const char * filename,
695                                                    LPDIRECT3DRMTEXTURE2 * ppTexture)
696 {
697     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
698
699     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
700
701     return E_NOTIMPL;
702 }
703
704 static HRESULT WINAPI IDirect3DRM2Impl_LoadTextureFromResource(IDirect3DRM2* iface, HMODULE hModule,
705                                                                LPCSTR strName, LPCSTR strType,
706                                                                LPDIRECT3DRMTEXTURE2 * ppTexture)
707 {
708     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
709
710     FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, hModule, strName, strType, ppTexture);
711
712     return E_NOTIMPL;
713 }
714
715 static HRESULT WINAPI IDirect3DRM2Impl_SetSearchPath(IDirect3DRM2* iface, LPCSTR path)
716 {
717     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
718
719     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
720
721     return E_NOTIMPL;
722 }
723
724 static HRESULT WINAPI IDirect3DRM2Impl_AddSearchPath(IDirect3DRM2* iface, LPCSTR path)
725 {
726     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
727
728     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
729
730     return E_NOTIMPL;
731 }
732
733 static HRESULT WINAPI IDirect3DRM2Impl_GetSearchPath(IDirect3DRM2* iface, DWORD *size_return,
734                                                      LPSTR path_return)
735 {
736     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
737
738     FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
739
740     return E_NOTIMPL;
741 }
742
743 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureColors(IDirect3DRM2* iface, DWORD nb_colors)
744 {
745     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
746
747     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
748
749     return E_NOTIMPL;
750 }
751
752 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureShades(IDirect3DRM2* iface, DWORD nb_shades)
753 {
754     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
755
756     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
757
758     return E_NOTIMPL;
759 }
760
761 static HRESULT WINAPI IDirect3DRM2Impl_GetDevices(IDirect3DRM2* iface,
762                                                   LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
763 {
764     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
765
766     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
767
768     return E_NOTIMPL;
769 }
770
771 static HRESULT WINAPI IDirect3DRM2Impl_GetNamedObject(IDirect3DRM2* iface, const char * pName,
772                                                       LPDIRECT3DRMOBJECT * ppObject)
773 {
774     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
775
776     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
777
778     return E_NOTIMPL;
779 }
780
781 static HRESULT WINAPI IDirect3DRM2Impl_EnumerateObjects(IDirect3DRM2* iface, D3DRMOBJECTCALLBACK cb,
782                                                         LPVOID pArg)
783 {
784     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
785
786     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
787
788     return E_NOTIMPL;
789 }
790
791 static HRESULT WINAPI IDirect3DRM2Impl_Load(IDirect3DRM2* iface, LPVOID pObjSource, LPVOID pObjID,
792                                             LPIID * ppGUIDs, DWORD nb_GUIDs,
793                                             D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc,
794                                             LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc,
795                                             LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
796 {
797     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
798
799     FIXME("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p): stub\n", iface, This, pObjSource, pObjID,
800           ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
801
802     return E_NOTIMPL;
803 }
804
805 static HRESULT WINAPI IDirect3DRM2Impl_Tick(IDirect3DRM2* iface, D3DVALUE tick)
806 {
807     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
808
809     FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
810
811     return E_NOTIMPL;
812 }
813
814 static HRESULT WINAPI IDirect3DRM2Impl_CreateProgressiveMesh(IDirect3DRM2* iface,
815                                                              LPDIRECT3DRMPROGRESSIVEMESH * ppMesh)
816 {
817     IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
818
819     FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
820
821     return E_NOTIMPL;
822 }
823
824 static const struct IDirect3DRM2Vtbl Direct3DRM2_Vtbl =
825 {
826     IDirect3DRM2Impl_QueryInterface,
827     IDirect3DRM2Impl_AddRef,
828     IDirect3DRM2Impl_Release,
829     IDirect3DRM2Impl_CreateObject,
830     IDirect3DRM2Impl_CreateFrame,
831     IDirect3DRM2Impl_CreateMesh,
832     IDirect3DRM2Impl_CreateMeshBuilder,
833     IDirect3DRM2Impl_CreateFace,
834     IDirect3DRM2Impl_CreateAnimation,
835     IDirect3DRM2Impl_CreateAnimationSet,
836     IDirect3DRM2Impl_CreateTexture,
837     IDirect3DRM2Impl_CreateLight,
838     IDirect3DRM2Impl_CreateLightRGB,
839     IDirect3DRM2Impl_Material,
840     IDirect3DRM2Impl_CreateDevice,
841     IDirect3DRM2Impl_CreateDeviceFromSurface,
842     IDirect3DRM2Impl_CreateDeviceFromD3D,
843     IDirect3DRM2Impl_CreateDeviceFromClipper,
844     IDirect3DRM2Impl_CreateTextureFromSurface,
845     IDirect3DRM2Impl_CreateShadow,
846     IDirect3DRM2Impl_CreateViewport,
847     IDirect3DRM2Impl_CreateWrap,
848     IDirect3DRM2Impl_CreateUserVisual,
849     IDirect3DRM2Impl_LoadTexture,
850     IDirect3DRM2Impl_LoadTextureFromResource,
851     IDirect3DRM2Impl_SetSearchPath,
852     IDirect3DRM2Impl_AddSearchPath,
853     IDirect3DRM2Impl_GetSearchPath,
854     IDirect3DRM2Impl_SetDefaultTextureColors,
855     IDirect3DRM2Impl_SetDefaultTextureShades,
856     IDirect3DRM2Impl_GetDevices,
857     IDirect3DRM2Impl_GetNamedObject,
858     IDirect3DRM2Impl_EnumerateObjects,
859     IDirect3DRM2Impl_Load,
860     IDirect3DRM2Impl_Tick,
861     IDirect3DRM2Impl_CreateProgressiveMesh
862 };
863
864
865 /*** IUnknown methods ***/
866 static HRESULT WINAPI IDirect3DRM3Impl_QueryInterface(IDirect3DRM3* iface, REFIID riid,
867                                                       void** ppvObject)
868 {
869     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
870     return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
871 }
872
873 static ULONG WINAPI IDirect3DRM3Impl_AddRef(IDirect3DRM3* iface)
874 {
875     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
876     return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
877 }
878
879 static ULONG WINAPI IDirect3DRM3Impl_Release(IDirect3DRM3* iface)
880 {
881     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
882     return IDirect3DRM_Release(&This->IDirect3DRM_iface);
883 }
884
885 /*** IDirect3DRM3 methods ***/
886 static HRESULT WINAPI IDirect3DRM3Impl_CreateObject(IDirect3DRM3* iface, REFCLSID rclsid,
887                                                     LPUNKNOWN unkwn, REFIID riid, LPVOID* object)
888 {
889     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
890
891     FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), unkwn,
892           debugstr_guid(riid), object);
893
894     return E_NOTIMPL;
895 }
896
897 static HRESULT WINAPI IDirect3DRM3Impl_CreateFrame(IDirect3DRM3* iface,
898                                                    LPDIRECT3DRMFRAME3 FrameParent,
899                                                    LPDIRECT3DRMFRAME3* Frame)
900 {
901     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
902
903     TRACE("(%p/%p)->(%p,%p)\n", iface, This, FrameParent, Frame);
904
905     if (FrameParent)
906         FIXME("(%p/%p): Parent frame not yet supported\n", iface, This);
907
908     return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3, (IUnknown**)Frame);
909 }
910
911 static HRESULT WINAPI IDirect3DRM3Impl_CreateMesh(IDirect3DRM3* iface, LPDIRECT3DRMMESH* Mesh)
912 {
913     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
914
915     FIXME("(%p/%p)->(%p): stub\n", iface, This, Mesh);
916
917     return E_NOTIMPL;
918 }
919
920 static HRESULT WINAPI IDirect3DRM3Impl_CreateMeshBuilder(IDirect3DRM3* iface,
921                                                          LPDIRECT3DRMMESHBUILDER3* ppMeshBuilder)
922 {
923     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
924
925     TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
926
927     return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder3, (IUnknown**)ppMeshBuilder);
928 }
929
930 static HRESULT WINAPI IDirect3DRM3Impl_CreateFace(IDirect3DRM3* iface, LPDIRECT3DRMFACE2* Face)
931 {
932     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
933
934     FIXME("(%p/%p)->(%p): stub\n", iface, This, Face);
935
936     return E_NOTIMPL;
937 }
938
939 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimation(IDirect3DRM3* iface,
940                                                        LPDIRECT3DRMANIMATION2* Animation)
941 {
942     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
943
944     FIXME("(%p/%p)->(%p): stub\n", iface, This, Animation);
945
946     return E_NOTIMPL;
947 }
948
949 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimationSet(IDirect3DRM3* iface,
950                                                           LPDIRECT3DRMANIMATIONSET2* AnimationSet)
951 {
952     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
953
954     FIXME("(%p/%p)->(%p): stub\n", iface, This, AnimationSet);
955
956     return E_NOTIMPL;
957 }
958
959 static HRESULT WINAPI IDirect3DRM3Impl_CreateTexture(IDirect3DRM3* iface, LPD3DRMIMAGE Image,
960                                                      LPDIRECT3DRMTEXTURE3* Texture)
961 {
962     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
963
964     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, Image, Texture);
965
966     return E_NOTIMPL;
967 }
968
969 static HRESULT WINAPI IDirect3DRM3Impl_CreateLight(IDirect3DRM3* iface, D3DRMLIGHTTYPE type,
970                                                    D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
971 {
972     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
973
974     FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, type, color, Light);
975
976     return E_NOTIMPL;
977 }
978
979 static HRESULT WINAPI IDirect3DRM3Impl_CreateLightRGB(IDirect3DRM3* iface, D3DRMLIGHTTYPE type,
980                                                       D3DVALUE red, D3DVALUE green, D3DVALUE blue,
981                                                       LPDIRECT3DRMLIGHT* Light)
982 {
983     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
984
985     FIXME("(%p/%p)->(%d,%f,%f,%f,%p): stub\n", iface, This, type, red, green, blue, Light);
986
987     return E_NOTIMPL;
988 }
989
990 static HRESULT WINAPI IDirect3DRM3Impl_Material(IDirect3DRM3* iface, D3DVALUE m,
991                                                 LPDIRECT3DRMMATERIAL2* Material)
992 {
993     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
994
995     FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, Material);
996
997     return E_NOTIMPL;
998 }
999
1000 static HRESULT WINAPI IDirect3DRM3Impl_CreateDevice(IDirect3DRM3* iface, DWORD width, DWORD height,
1001                                                     LPDIRECT3DRMDEVICE3* device)
1002 {
1003     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1004
1005     FIXME("(%p/%p)->(%d,%d,%p): partial stub\n", iface, This, width, height, device);
1006
1007     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1008 }
1009
1010 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromSurface(IDirect3DRM3* iface, LPGUID pGUID,
1011                                                                LPDIRECTDRAW dd,
1012                                                                LPDIRECTDRAWSURFACE back,
1013                                                                LPDIRECT3DRMDEVICE3* device)
1014 {
1015     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1016
1017     FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), dd, back, device);
1018
1019     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1020 }
1021
1022 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromD3D(IDirect3DRM3* iface, LPDIRECT3D2 d3d,
1023                                                            LPDIRECT3DDEVICE2 d3ddev,
1024                                                            LPDIRECT3DRMDEVICE3* device)
1025 {
1026     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1027
1028     FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, d3d, d3ddev, device);
1029
1030     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1031 }
1032
1033 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromClipper(IDirect3DRM3* iface,
1034                                                                LPDIRECTDRAWCLIPPER clipper,
1035                                                                LPGUID GUID, int width, int height,
1036                                                                LPDIRECT3DRMDEVICE3* device)
1037 {
1038     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1039
1040     FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, clipper, debugstr_guid(GUID),
1041           width, height, device);
1042
1043     return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1044 }
1045
1046 static HRESULT WINAPI IDirect3DRM3Impl_CreateShadow(IDirect3DRM3* iface, LPUNKNOWN Visual1,
1047                                                     LPDIRECT3DRMLIGHT Light, D3DVALUE px,
1048                                                     D3DVALUE py, D3DVALUE pz, D3DVALUE nx,
1049                                                     D3DVALUE ny, D3DVALUE nz,
1050                                                     LPDIRECT3DRMSHADOW2* Visual2)
1051 {
1052     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1053
1054     FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, Visual1, Light, px, py, pz,
1055           nx, ny, nz, Visual2);
1056
1057     return E_NOTIMPL;
1058 }
1059
1060 static HRESULT WINAPI IDirect3DRM3Impl_CreateTextureFromSurface(IDirect3DRM3* iface,
1061                                                                 LPDIRECTDRAWSURFACE surface,
1062                                                                 LPDIRECT3DRMTEXTURE3* texture)
1063 {
1064     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1065
1066     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, surface, texture);
1067
1068     return E_NOTIMPL;
1069 }
1070
1071 static HRESULT WINAPI IDirect3DRM3Impl_CreateViewport(IDirect3DRM3* iface,
1072                                                       LPDIRECT3DRMDEVICE3 Device,
1073                                                       LPDIRECT3DRMFRAME3 frame, DWORD xpos,
1074                                                       DWORD ypos, DWORD width, DWORD height,
1075                                                       LPDIRECT3DRMVIEWPORT2* viewport)
1076 {
1077     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1078
1079     FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface, This, Device, frame, xpos, ypos, width,
1080           height, viewport);
1081
1082     return Direct3DRMViewport_create(&IID_IDirect3DRMViewport2, (IUnknown**)viewport);
1083 }
1084
1085 static HRESULT WINAPI IDirect3DRM3Impl_CreateWrap(IDirect3DRM3* iface, D3DRMWRAPTYPE type,
1086                                                   LPDIRECT3DRMFRAME3 frame,
1087                                                   D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
1088                                                   D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
1089                                                   D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
1090                                                   D3DVALUE ou, D3DVALUE ov, D3DVALUE su,
1091                                                   D3DVALUE sv, LPDIRECT3DRMWRAP* wrap)
1092 {
1093     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1094
1095     FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type,
1096           frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
1097
1098     return E_NOTIMPL;
1099 }
1100
1101 static HRESULT WINAPI IDirect3DRM3Impl_CreateUserVisual(IDirect3DRM3* iface,
1102                                                         D3DRMUSERVISUALCALLBACK cb, LPVOID arg,
1103                                                         LPDIRECT3DRMUSERVISUAL* UserVisual)
1104 {
1105     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1106
1107     FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, arg, UserVisual);
1108
1109     return E_NOTIMPL;
1110 }
1111
1112 static HRESULT WINAPI IDirect3DRM3Impl_LoadTexture(IDirect3DRM3* iface, const char* filename,
1113                                                    LPDIRECT3DRMTEXTURE3* Texture)
1114 {
1115     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1116
1117     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, Texture);
1118
1119     return E_NOTIMPL;
1120 }
1121
1122 static HRESULT WINAPI IDirect3DRM3Impl_LoadTextureFromResource(IDirect3DRM3* iface, HMODULE mod,
1123                                                                LPCSTR strName, LPCSTR strType,
1124                                                                LPDIRECT3DRMTEXTURE3 * ppTexture)
1125 {
1126     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1127
1128     FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, mod, strName, strType, ppTexture);
1129
1130     return E_NOTIMPL;
1131 }
1132
1133 static HRESULT WINAPI IDirect3DRM3Impl_SetSearchPath(IDirect3DRM3* iface, LPCSTR path)
1134 {
1135     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1136
1137     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1138
1139     return E_NOTIMPL;
1140 }
1141
1142 static HRESULT WINAPI IDirect3DRM3Impl_AddSearchPath(IDirect3DRM3* iface, LPCSTR path)
1143 {
1144     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1145
1146     FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1147
1148     return E_NOTIMPL;
1149 }
1150
1151 static HRESULT WINAPI IDirect3DRM3Impl_GetSearchPath(IDirect3DRM3* iface, DWORD* size_return,
1152                                                      LPSTR path_return)
1153 {
1154     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1155
1156     FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
1157
1158     return E_NOTIMPL;
1159 }
1160
1161 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureColors(IDirect3DRM3* iface, DWORD nb_colors)
1162 {
1163     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1164
1165     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
1166
1167     return E_NOTIMPL;
1168 }
1169
1170 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureShades(IDirect3DRM3* iface, DWORD nb_shades)
1171 {
1172     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1173
1174     FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
1175
1176     return E_NOTIMPL;
1177 }
1178
1179 static HRESULT WINAPI IDirect3DRM3Impl_GetDevices(IDirect3DRM3* iface,
1180                                                   LPDIRECT3DRMDEVICEARRAY* DeviceArray)
1181 {
1182     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1183
1184     FIXME("(%p/%p)->(%p): stub\n", iface, This, DeviceArray);
1185
1186     return E_NOTIMPL;
1187 }
1188
1189 static HRESULT WINAPI IDirect3DRM3Impl_GetNamedObject(IDirect3DRM3* iface, const char* Name,
1190                                                       LPDIRECT3DRMOBJECT* Object)
1191 {
1192     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1193
1194     FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, Name, Object);
1195
1196     return E_NOTIMPL;
1197 }
1198
1199 static HRESULT WINAPI IDirect3DRM3Impl_EnumerateObjects(IDirect3DRM3* iface, D3DRMOBJECTCALLBACK cb,
1200                                                         LPVOID arg)
1201 {
1202     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1203
1204     FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, arg);
1205
1206     return E_NOTIMPL;
1207 }
1208
1209 static HRESULT WINAPI IDirect3DRM3Impl_Load(IDirect3DRM3* iface, LPVOID ObjSource, LPVOID ObjID,
1210                                             LPIID* GUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags,
1211                                             D3DRMLOADCALLBACK LoadProc, LPVOID ArgLP,
1212                                             D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID ArgLTP,
1213                                             LPDIRECT3DRMFRAME3 ParentFrame)
1214 {
1215     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1216
1217     FIXME("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p): stub\n", iface, This, ObjSource, ObjID, GUIDs,
1218           nb_GUIDs, LOFlags, LoadProc, ArgLP, LoadTextureProc, ArgLTP, ParentFrame);
1219
1220     return E_NOTIMPL;
1221 }
1222
1223 static HRESULT WINAPI IDirect3DRM3Impl_Tick(IDirect3DRM3* iface, D3DVALUE tick)
1224 {
1225     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1226
1227     FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
1228
1229     return E_NOTIMPL;
1230 }
1231
1232 static HRESULT WINAPI IDirect3DRM3Impl_CreateProgressiveMesh(IDirect3DRM3* iface,
1233                                                              LPDIRECT3DRMPROGRESSIVEMESH Mesh)
1234 {
1235     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1236
1237     FIXME("(%p/%p)->(%p): stub\n", iface, This, Mesh);
1238
1239     return E_NOTIMPL;
1240 }
1241
1242 static HRESULT WINAPI IDirect3DRM3Impl_RegisterClient(IDirect3DRM3* iface, REFGUID rguid,
1243                                                       LPDWORD id)
1244 {
1245     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1246
1247     FIXME("(%p/%p)->(%s, %p): stub\n", iface, This, debugstr_guid(rguid), id);
1248
1249     return E_NOTIMPL;
1250 }
1251
1252 static HRESULT WINAPI IDirect3DRM3Impl_UnregisterClient(IDirect3DRM3* iface, REFGUID rguid)
1253 {
1254     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1255
1256     FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_guid(rguid));
1257
1258     return E_NOTIMPL;
1259 }
1260
1261 static HRESULT WINAPI IDirect3DRM3Impl_CreateClippedVisual(IDirect3DRM3* iface,
1262                                                            LPDIRECT3DRMVISUAL vis,
1263                                                            LPDIRECT3DRMCLIPPEDVISUAL* clippedvis)
1264 {
1265     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1266
1267     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, vis, clippedvis);
1268
1269     return E_NOTIMPL;
1270 }
1271
1272 static HRESULT WINAPI IDirect3DRM3Impl_SetOptions(IDirect3DRM3* iface, DWORD opt)
1273 {
1274     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1275
1276     FIXME("(%p/%p)->(%d): stub\n", iface, This, opt);
1277
1278     return E_NOTIMPL;
1279 }
1280
1281 static HRESULT WINAPI IDirect3DRM3Impl_GetOptions(IDirect3DRM3* iface, LPDWORD opt)
1282 {
1283     IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1284
1285     FIXME("(%p/%p)->(%p): stub\n", iface, This, opt);
1286
1287     return E_NOTIMPL;
1288 }
1289
1290 static const struct IDirect3DRM3Vtbl Direct3DRM3_Vtbl =
1291 {
1292     IDirect3DRM3Impl_QueryInterface,
1293     IDirect3DRM3Impl_AddRef,
1294     IDirect3DRM3Impl_Release,
1295     IDirect3DRM3Impl_CreateObject,
1296     IDirect3DRM3Impl_CreateFrame,
1297     IDirect3DRM3Impl_CreateMesh,
1298     IDirect3DRM3Impl_CreateMeshBuilder,
1299     IDirect3DRM3Impl_CreateFace,
1300     IDirect3DRM3Impl_CreateAnimation,
1301     IDirect3DRM3Impl_CreateAnimationSet,
1302     IDirect3DRM3Impl_CreateTexture,
1303     IDirect3DRM3Impl_CreateLight,
1304     IDirect3DRM3Impl_CreateLightRGB,
1305     IDirect3DRM3Impl_Material,
1306     IDirect3DRM3Impl_CreateDevice,
1307     IDirect3DRM3Impl_CreateDeviceFromSurface,
1308     IDirect3DRM3Impl_CreateDeviceFromD3D,
1309     IDirect3DRM3Impl_CreateDeviceFromClipper,
1310     IDirect3DRM3Impl_CreateTextureFromSurface,
1311     IDirect3DRM3Impl_CreateShadow,
1312     IDirect3DRM3Impl_CreateViewport,
1313     IDirect3DRM3Impl_CreateWrap,
1314     IDirect3DRM3Impl_CreateUserVisual,
1315     IDirect3DRM3Impl_LoadTexture,
1316     IDirect3DRM3Impl_LoadTextureFromResource,
1317     IDirect3DRM3Impl_SetSearchPath,
1318     IDirect3DRM3Impl_AddSearchPath,
1319     IDirect3DRM3Impl_GetSearchPath,
1320     IDirect3DRM3Impl_SetDefaultTextureColors,
1321     IDirect3DRM3Impl_SetDefaultTextureShades,
1322     IDirect3DRM3Impl_GetDevices,
1323     IDirect3DRM3Impl_GetNamedObject,
1324     IDirect3DRM3Impl_EnumerateObjects,
1325     IDirect3DRM3Impl_Load,
1326     IDirect3DRM3Impl_Tick,
1327     IDirect3DRM3Impl_CreateProgressiveMesh,
1328     IDirect3DRM3Impl_RegisterClient,
1329     IDirect3DRM3Impl_UnregisterClient,
1330     IDirect3DRM3Impl_CreateClippedVisual,
1331     IDirect3DRM3Impl_SetOptions,
1332     IDirect3DRM3Impl_GetOptions
1333 };
1334
1335 HRESULT Direct3DRM_create(IUnknown** ppObj)
1336 {
1337     IDirect3DRMImpl* object;
1338
1339     TRACE("(%p)\n", ppObj);
1340
1341     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMImpl));
1342     if (!object)
1343     {
1344         ERR("Out of memory\n");
1345         return E_OUTOFMEMORY;
1346     }
1347
1348     object->IDirect3DRM_iface.lpVtbl = &Direct3DRM_Vtbl;
1349     object->IDirect3DRM2_iface.lpVtbl = &Direct3DRM2_Vtbl;
1350     object->IDirect3DRM3_iface.lpVtbl = &Direct3DRM3_Vtbl;
1351     object->ref = 1;
1352
1353     *ppObj = (IUnknown*)&object->IDirect3DRM_iface;
1354
1355     return S_OK;
1356 }