2 * Implementation of IDirect3DRM Interface
4 * Copyright 2010, 2012 Christian Costa
5 * Copyright 2011 André Hentschel
6 * Copyright 2016 Aaryaman Vasishta
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "wine/debug.h"
32 #include "d3drm_private.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(d3drm
);
36 static const char* get_IID_string(const GUID
* guid
)
38 if (IsEqualGUID(guid
, &IID_IDirect3DRMFrame
))
39 return "IID_IDirect3DRMFrame";
40 else if (IsEqualGUID(guid
, &IID_IDirect3DRMFrame2
))
41 return "IID_IDirect3DRMFrame2";
42 else if (IsEqualGUID(guid
, &IID_IDirect3DRMFrame3
))
43 return "IID_IDirect3DRMFrame3";
44 else if (IsEqualGUID(guid
, &IID_IDirect3DRMMeshBuilder
))
45 return "IID_IDirect3DRMMeshBuilder";
46 else if (IsEqualGUID(guid
, &IID_IDirect3DRMMeshBuilder2
))
47 return "IID_IDirect3DRMMeshBuilder2";
48 else if (IsEqualGUID(guid
, &IID_IDirect3DRMMeshBuilder3
))
49 return "IID_IDirect3DRMMeshBuilder3";
56 IDirect3DRM IDirect3DRM_iface
;
57 IDirect3DRM2 IDirect3DRM2_iface
;
58 IDirect3DRM3 IDirect3DRM3_iface
;
59 LONG ref1
, ref2
, ref3
, iface_count
;
62 static inline struct d3drm
*impl_from_IDirect3DRM(IDirect3DRM
*iface
)
64 return CONTAINING_RECORD(iface
, struct d3drm
, IDirect3DRM_iface
);
67 static inline struct d3drm
*impl_from_IDirect3DRM2(IDirect3DRM2
*iface
)
69 return CONTAINING_RECORD(iface
, struct d3drm
, IDirect3DRM2_iface
);
72 static inline struct d3drm
*impl_from_IDirect3DRM3(IDirect3DRM3
*iface
)
74 return CONTAINING_RECORD(iface
, struct d3drm
, IDirect3DRM3_iface
);
77 static void d3drm_destroy(struct d3drm
*d3drm
)
79 HeapFree(GetProcessHeap(), 0, d3drm
);
80 TRACE("d3drm object %p is being destroyed.\n", d3drm
);
83 static HRESULT WINAPI
d3drm1_QueryInterface(IDirect3DRM
*iface
, REFIID riid
, void **out
)
85 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
87 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
89 if (IsEqualGUID(riid
, &IID_IDirect3DRM
)
90 || IsEqualGUID(riid
, &IID_IUnknown
))
92 *out
= &d3drm
->IDirect3DRM_iface
;
94 else if (IsEqualGUID(riid
, &IID_IDirect3DRM2
))
96 *out
= &d3drm
->IDirect3DRM2_iface
;
98 else if (IsEqualGUID(riid
, &IID_IDirect3DRM3
))
100 *out
= &d3drm
->IDirect3DRM3_iface
;
105 WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid
));
106 return CLASS_E_CLASSNOTAVAILABLE
;
109 IUnknown_AddRef((IUnknown
*)*out
);
113 static ULONG WINAPI
d3drm1_AddRef(IDirect3DRM
*iface
)
115 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
116 ULONG refcount
= InterlockedIncrement(&d3drm
->ref1
);
118 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
121 InterlockedIncrement(&d3drm
->iface_count
);
126 static ULONG WINAPI
d3drm1_Release(IDirect3DRM
*iface
)
128 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
129 ULONG refcount
= InterlockedDecrement(&d3drm
->ref1
);
131 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
133 if (!refcount
&& !InterlockedDecrement(&d3drm
->iface_count
))
134 d3drm_destroy(d3drm
);
139 static HRESULT WINAPI
d3drm1_CreateObject(IDirect3DRM
*iface
,
140 REFCLSID clsid
, IUnknown
*outer
, REFIID iid
, void **out
)
142 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
144 TRACE("iface %p, clsid %s, outer %p, iid %s, out %p.\n",
145 iface
, debugstr_guid(clsid
), outer
, debugstr_guid(iid
), out
);
147 return IDirect3DRM3_CreateObject(&d3drm
->IDirect3DRM3_iface
, clsid
, outer
, iid
, out
);
150 static HRESULT WINAPI
d3drm1_CreateFrame(IDirect3DRM
*iface
,
151 IDirect3DRMFrame
*parent_frame
, IDirect3DRMFrame
**frame
)
153 TRACE("iface %p, parent_frame %p, frame %p.\n", iface
, parent_frame
, frame
);
155 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame
, (IUnknown
*)parent_frame
, (IUnknown
**)frame
);
158 static HRESULT WINAPI
d3drm1_CreateMesh(IDirect3DRM
*iface
, IDirect3DRMMesh
**mesh
)
160 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
162 TRACE("iface %p, mesh %p.\n", iface
, mesh
);
164 return IDirect3DRM3_CreateMesh(&d3drm
->IDirect3DRM3_iface
, mesh
);
167 static HRESULT WINAPI
d3drm1_CreateMeshBuilder(IDirect3DRM
*iface
, IDirect3DRMMeshBuilder
**mesh_builder
)
169 TRACE("iface %p, mesh_builder %p.\n", iface
, mesh_builder
);
171 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder
, (IUnknown
**)mesh_builder
);
174 static HRESULT WINAPI
d3drm1_CreateFace(IDirect3DRM
*iface
, IDirect3DRMFace
**face
)
176 TRACE("iface %p, face %p.\n", iface
, face
);
178 return Direct3DRMFace_create(&IID_IDirect3DRMFace
, (IUnknown
**)face
);
181 static HRESULT WINAPI
d3drm1_CreateAnimation(IDirect3DRM
*iface
, IDirect3DRMAnimation
**animation
)
183 FIXME("iface %p, animation %p stub!\n", iface
, animation
);
188 static HRESULT WINAPI
d3drm1_CreateAnimationSet(IDirect3DRM
*iface
, IDirect3DRMAnimationSet
**set
)
190 FIXME("iface %p, set %p stub!\n", iface
, set
);
195 static HRESULT WINAPI
d3drm1_CreateTexture(IDirect3DRM
*iface
,
196 D3DRMIMAGE
*image
, IDirect3DRMTexture
**texture
)
198 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
199 IDirect3DRMTexture3
*texture3
;
202 TRACE("iface %p, image %p, texture %p.\n", iface
, image
, texture
);
205 return D3DRMERR_BADVALUE
;
207 if (FAILED(hr
= IDirect3DRM3_CreateTexture(&d3drm
->IDirect3DRM3_iface
, image
, &texture3
)))
213 hr
= IDirect3DRMTexture3_QueryInterface(texture3
, &IID_IDirect3DRMTexture
, (void **)texture
);
214 IDirect3DRMTexture3_Release(texture3
);
219 static HRESULT WINAPI
d3drm1_CreateLight(IDirect3DRM
*iface
,
220 D3DRMLIGHTTYPE type
, D3DCOLOR color
, IDirect3DRMLight
**light
)
222 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
224 TRACE("iface %p, type %#x, color 0x%08x, light %p.\n", iface
, type
, color
, light
);
226 return IDirect3DRM3_CreateLight(&d3drm
->IDirect3DRM3_iface
, type
, color
, light
);
229 static HRESULT WINAPI
d3drm1_CreateLightRGB(IDirect3DRM
*iface
, D3DRMLIGHTTYPE type
,
230 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
, IDirect3DRMLight
**light
)
232 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
234 TRACE("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p.\n",
235 iface
, type
, red
, green
, blue
, light
);
237 return IDirect3DRM3_CreateLightRGB(&d3drm
->IDirect3DRM3_iface
, type
, red
, green
, blue
, light
);
240 static HRESULT WINAPI
d3drm1_CreateMaterial(IDirect3DRM
*iface
,
241 D3DVALUE power
, IDirect3DRMMaterial
**material
)
243 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
245 TRACE("iface %p, power %.8e, material %p.\n", iface
, power
, material
);
247 return IDirect3DRM3_CreateMaterial(&d3drm
->IDirect3DRM3_iface
, power
, (IDirect3DRMMaterial2
**)material
);
250 static HRESULT WINAPI
d3drm1_CreateDevice(IDirect3DRM
*iface
,
251 DWORD width
, DWORD height
, IDirect3DRMDevice
**device
)
253 struct d3drm_device
*object
;
255 FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface
, width
, height
, device
);
257 hr
= d3drm_device_create(&object
);
261 *device
= IDirect3DRMDevice_from_impl(object
);
266 static HRESULT WINAPI
d3drm1_CreateDeviceFromSurface(IDirect3DRM
*iface
, GUID
*guid
,
267 IDirectDraw
*ddraw
, IDirectDrawSurface
*backbuffer
, IDirect3DRMDevice
**device
)
269 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
270 struct d3drm_device
*object
;
273 TRACE("iface %p, guid %s, ddraw %p, backbuffer %p, device %p.\n",
274 iface
, debugstr_guid(guid
), ddraw
, backbuffer
, device
);
277 return D3DRMERR_BADVALUE
;
280 if (!backbuffer
|| !ddraw
)
281 return D3DRMERR_BADDEVICE
;
283 hr
= d3drm_device_create(&object
);
287 hr
= d3drm_device_init(object
, 1, &d3drm
->IDirect3DRM_iface
, ddraw
, backbuffer
, TRUE
);
289 *device
= IDirect3DRMDevice_from_impl(object
);
291 d3drm_device_destroy(object
);
296 static HRESULT WINAPI
d3drm1_CreateDeviceFromD3D(IDirect3DRM
*iface
,
297 IDirect3D
*d3d
, IDirect3DDevice
*d3d_device
, IDirect3DRMDevice
**device
)
299 struct d3drm_device
*object
;
301 TRACE("iface %p, d3d %p, d3d_device %p, device %p.\n",
302 iface
, d3d
, d3d_device
, device
);
305 return D3DRMERR_BADVALUE
;
307 if (!d3d
|| !d3d_device
)
308 return D3DRMERR_BADVALUE
;
310 hr
= d3drm_device_create(&object
);
314 hr
= d3drm_device_set_ddraw_device_d3d(object
, iface
, d3d
, d3d_device
);
317 d3drm_device_destroy(object
);
320 *device
= IDirect3DRMDevice_from_impl(object
);
325 static HRESULT WINAPI
d3drm1_CreateDeviceFromClipper(IDirect3DRM
*iface
,
326 IDirectDrawClipper
*clipper
, GUID
*guid
, int width
, int height
,
327 IDirect3DRMDevice
**device
)
329 struct d3drm_device
*object
;
331 IDirectDrawSurface
*render_target
;
334 TRACE("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
335 iface
, clipper
, debugstr_guid(guid
), width
, height
, device
);
338 return D3DRMERR_BADVALUE
;
341 if (!clipper
|| !width
|| !height
)
342 return D3DRMERR_BADVALUE
;
344 hr
= DirectDrawCreate(NULL
, &ddraw
, NULL
);
348 hr
= d3drm_device_create(&object
);
351 IDirectDraw_Release(ddraw
);
355 hr
= d3drm_device_create_surfaces_from_clipper(object
, ddraw
, clipper
, width
, height
, &render_target
);
358 IDirectDraw_Release(ddraw
);
359 d3drm_device_destroy(object
);
363 hr
= d3drm_device_init(object
, 1, iface
, ddraw
, render_target
, TRUE
);
364 IDirectDraw_Release(ddraw
);
365 IDirectDrawSurface_Release(render_target
);
367 d3drm_device_destroy(object
);
369 *device
= IDirect3DRMDevice_from_impl(object
);
374 static HRESULT WINAPI
d3drm1_CreateTextureFromSurface(IDirect3DRM
*iface
,
375 IDirectDrawSurface
*surface
, IDirect3DRMTexture
**texture
)
377 FIXME("iface %p, surface %p, texture %p stub!\n", iface
, surface
, texture
);
382 static HRESULT WINAPI
d3drm1_CreateShadow(IDirect3DRM
*iface
, IDirect3DRMVisual
*visual
,
383 IDirect3DRMLight
*light
, D3DVALUE px
, D3DVALUE py
, D3DVALUE pz
, D3DVALUE nx
, D3DVALUE ny
, D3DVALUE nz
,
384 IDirect3DRMVisual
**shadow
)
386 FIXME("iface %p, visual %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n",
387 iface
, visual
, light
, px
, py
, pz
, nx
, ny
, nz
, shadow
);
392 static HRESULT WINAPI
d3drm1_CreateViewport(IDirect3DRM
*iface
, IDirect3DRMDevice
*device
,
393 IDirect3DRMFrame
*camera
, DWORD x
, DWORD y
, DWORD width
, DWORD height
, IDirect3DRMViewport
**viewport
)
395 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n",
396 iface
, device
, camera
, x
, y
, width
, height
, viewport
);
398 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport
, (IUnknown
**)viewport
);
401 static HRESULT WINAPI
d3drm1_CreateWrap(IDirect3DRM
*iface
, D3DRMWRAPTYPE type
, IDirect3DRMFrame
*frame
,
402 D3DVALUE ox
, D3DVALUE oy
, D3DVALUE oz
, D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
,
403 D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
, D3DVALUE ou
, D3DVALUE ov
, D3DVALUE su
, D3DVALUE sv
,
404 IDirect3DRMWrap
**wrap
)
406 FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
407 "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
408 iface
, type
, frame
, ox
, oy
, oz
, dx
, dy
, dz
, ux
, uy
, uz
, ou
, ov
, su
, sv
, wrap
);
413 static HRESULT WINAPI
d3drm1_CreateUserVisual(IDirect3DRM
*iface
,
414 D3DRMUSERVISUALCALLBACK cb
, void *ctx
, IDirect3DRMUserVisual
**visual
)
416 FIXME("iface %p, cb %p, ctx %p visual %p stub!\n", iface
, cb
, ctx
, visual
);
421 static HRESULT WINAPI
d3drm1_LoadTexture(IDirect3DRM
*iface
,
422 const char *filename
, IDirect3DRMTexture
**texture
)
424 struct d3drm_texture
*object
;
427 FIXME("iface %p, filename %s, texture %p stub!\n", iface
, debugstr_a(filename
), texture
);
429 if (FAILED(hr
= d3drm_texture_create(&object
, iface
)))
432 *texture
= &object
->IDirect3DRMTexture_iface
;
437 static HRESULT WINAPI
d3drm1_LoadTextureFromResource(IDirect3DRM
*iface
,
438 HRSRC resource
, IDirect3DRMTexture
**texture
)
440 struct d3drm_texture
*object
;
443 FIXME("iface %p, resource %p, texture %p stub!\n", iface
, resource
, texture
);
445 if (FAILED(hr
= d3drm_texture_create(&object
, iface
)))
448 *texture
= &object
->IDirect3DRMTexture_iface
;
453 static HRESULT WINAPI
d3drm1_SetSearchPath(IDirect3DRM
*iface
, const char *path
)
455 FIXME("iface %p, path %s stub!\n", iface
, debugstr_a(path
));
460 static HRESULT WINAPI
d3drm1_AddSearchPath(IDirect3DRM
*iface
, const char *path
)
462 FIXME("iface %p, path %s stub!\n", iface
, debugstr_a(path
));
467 static HRESULT WINAPI
d3drm1_GetSearchPath(IDirect3DRM
*iface
, DWORD
*size
, char *path
)
469 FIXME("iface %p, size %p, path %p stub!\n", iface
, size
, path
);
474 static HRESULT WINAPI
d3drm1_SetDefaultTextureColors(IDirect3DRM
*iface
, DWORD color_count
)
476 FIXME("iface %p, color_count %u stub!\n", iface
, color_count
);
481 static HRESULT WINAPI
d3drm1_SetDefaultTextureShades(IDirect3DRM
*iface
, DWORD shade_count
)
483 FIXME("iface %p, shade_count %u stub!\n", iface
, shade_count
);
488 static HRESULT WINAPI
d3drm1_GetDevices(IDirect3DRM
*iface
, IDirect3DRMDeviceArray
**array
)
490 FIXME("iface %p, array %p stub!\n", iface
, array
);
495 static HRESULT WINAPI
d3drm1_GetNamedObject(IDirect3DRM
*iface
,
496 const char *name
, IDirect3DRMObject
**object
)
498 FIXME("iface %p, name %s, object %p stub!\n", iface
, debugstr_a(name
), object
);
503 static HRESULT WINAPI
d3drm1_EnumerateObjects(IDirect3DRM
*iface
, D3DRMOBJECTCALLBACK cb
, void *ctx
)
505 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
510 static HRESULT WINAPI
d3drm1_Load(IDirect3DRM
*iface
, void *source
, void *object_id
, IID
**iids
,
511 DWORD iid_count
, D3DRMLOADOPTIONS flags
, D3DRMLOADCALLBACK load_cb
, void *load_ctx
,
512 D3DRMLOADTEXTURECALLBACK load_tex_cb
, void *load_tex_ctx
, IDirect3DRMFrame
*parent_frame
)
514 struct d3drm
*d3drm
= impl_from_IDirect3DRM(iface
);
515 IDirect3DRMFrame3
*parent_frame3
= NULL
;
516 HRESULT hr
= D3DRM_OK
;
518 TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, "
519 "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n",
520 iface
, source
, object_id
, iids
, iid_count
, flags
,
521 load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame
);
524 hr
= IDirect3DRMFrame_QueryInterface(parent_frame
, &IID_IDirect3DRMFrame3
, (void **)&parent_frame3
);
526 hr
= IDirect3DRM3_Load(&d3drm
->IDirect3DRM3_iface
, source
, object_id
, iids
, iid_count
,
527 flags
, load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame3
);
529 IDirect3DRMFrame3_Release(parent_frame3
);
534 static HRESULT WINAPI
d3drm1_Tick(IDirect3DRM
*iface
, D3DVALUE tick
)
536 FIXME("iface %p, tick %.8e stub!\n", iface
, tick
);
541 static const struct IDirect3DRMVtbl d3drm1_vtbl
=
543 d3drm1_QueryInterface
,
549 d3drm1_CreateMeshBuilder
,
551 d3drm1_CreateAnimation
,
552 d3drm1_CreateAnimationSet
,
553 d3drm1_CreateTexture
,
555 d3drm1_CreateLightRGB
,
556 d3drm1_CreateMaterial
,
558 d3drm1_CreateDeviceFromSurface
,
559 d3drm1_CreateDeviceFromD3D
,
560 d3drm1_CreateDeviceFromClipper
,
561 d3drm1_CreateTextureFromSurface
,
563 d3drm1_CreateViewport
,
565 d3drm1_CreateUserVisual
,
567 d3drm1_LoadTextureFromResource
,
568 d3drm1_SetSearchPath
,
569 d3drm1_AddSearchPath
,
570 d3drm1_GetSearchPath
,
571 d3drm1_SetDefaultTextureColors
,
572 d3drm1_SetDefaultTextureShades
,
574 d3drm1_GetNamedObject
,
575 d3drm1_EnumerateObjects
,
580 static HRESULT WINAPI
d3drm2_QueryInterface(IDirect3DRM2
*iface
, REFIID riid
, void **out
)
582 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
584 return d3drm1_QueryInterface(&d3drm
->IDirect3DRM_iface
, riid
, out
);
587 static ULONG WINAPI
d3drm2_AddRef(IDirect3DRM2
*iface
)
589 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
590 ULONG refcount
= InterlockedIncrement(&d3drm
->ref2
);
592 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
595 InterlockedIncrement(&d3drm
->iface_count
);
600 static ULONG WINAPI
d3drm2_Release(IDirect3DRM2
*iface
)
602 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
603 ULONG refcount
= InterlockedDecrement(&d3drm
->ref2
);
605 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
607 if (!refcount
&& !InterlockedDecrement(&d3drm
->iface_count
))
608 d3drm_destroy(d3drm
);
613 static HRESULT WINAPI
d3drm2_CreateObject(IDirect3DRM2
*iface
,
614 REFCLSID clsid
, IUnknown
*outer
, REFIID iid
, void **out
)
616 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
618 TRACE("iface %p, clsid %s, outer %p, iid %s, out %p.\n",
619 iface
, debugstr_guid(clsid
), outer
, debugstr_guid(iid
), out
);
621 return IDirect3DRM3_CreateObject(&d3drm
->IDirect3DRM3_iface
, clsid
, outer
, iid
, out
);
624 static HRESULT WINAPI
d3drm2_CreateFrame(IDirect3DRM2
*iface
,
625 IDirect3DRMFrame
*parent_frame
, IDirect3DRMFrame2
**frame
)
627 TRACE("iface %p, parent_frame %p, frame %p.\n", iface
, parent_frame
, frame
);
629 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2
, (IUnknown
*)parent_frame
, (IUnknown
**)frame
);
632 static HRESULT WINAPI
d3drm2_CreateMesh(IDirect3DRM2
*iface
, IDirect3DRMMesh
**mesh
)
634 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
636 TRACE("iface %p, mesh %p.\n", iface
, mesh
);
638 return IDirect3DRM3_CreateMesh(&d3drm
->IDirect3DRM3_iface
, mesh
);
641 static HRESULT WINAPI
d3drm2_CreateMeshBuilder(IDirect3DRM2
*iface
, IDirect3DRMMeshBuilder2
**mesh_builder
)
643 TRACE("iface %p, mesh_builder %p.\n", iface
, mesh_builder
);
645 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder2
, (IUnknown
**)mesh_builder
);
648 static HRESULT WINAPI
d3drm2_CreateFace(IDirect3DRM2
*iface
, IDirect3DRMFace
**face
)
650 TRACE("iface %p, face %p.\n", iface
, face
);
652 return Direct3DRMFace_create(&IID_IDirect3DRMFace
, (IUnknown
**)face
);
655 static HRESULT WINAPI
d3drm2_CreateAnimation(IDirect3DRM2
*iface
, IDirect3DRMAnimation
**animation
)
657 FIXME("iface %p, animation %p stub!\n", iface
, animation
);
662 static HRESULT WINAPI
d3drm2_CreateAnimationSet(IDirect3DRM2
*iface
, IDirect3DRMAnimationSet
**set
)
664 FIXME("iface %p, set %p stub!\n", iface
, set
);
669 static HRESULT WINAPI
d3drm2_CreateTexture(IDirect3DRM2
*iface
,
670 D3DRMIMAGE
*image
, IDirect3DRMTexture2
**texture
)
672 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
673 IDirect3DRMTexture3
*texture3
;
676 TRACE("iface %p, image %p, texture %p.\n", iface
, image
, texture
);
679 return D3DRMERR_BADVALUE
;
681 if (FAILED(hr
= IDirect3DRM3_CreateTexture(&d3drm
->IDirect3DRM3_iface
, image
, &texture3
)))
687 hr
= IDirect3DRMTexture3_QueryInterface(texture3
, &IID_IDirect3DRMTexture2
, (void **)texture
);
688 IDirect3DRMTexture3_Release(texture3
);
693 static HRESULT WINAPI
d3drm2_CreateLight(IDirect3DRM2
*iface
,
694 D3DRMLIGHTTYPE type
, D3DCOLOR color
, IDirect3DRMLight
**light
)
696 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
698 TRACE("iface %p, type %#x, color 0x%08x, light %p.\n", iface
, type
, color
, light
);
700 return IDirect3DRM3_CreateLight(&d3drm
->IDirect3DRM3_iface
, type
, color
, light
);
703 static HRESULT WINAPI
d3drm2_CreateLightRGB(IDirect3DRM2
*iface
, D3DRMLIGHTTYPE type
,
704 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
, IDirect3DRMLight
**light
)
706 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
708 TRACE("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p.\n",
709 iface
, type
, red
, green
, blue
, light
);
711 return IDirect3DRM3_CreateLightRGB(&d3drm
->IDirect3DRM3_iface
, type
, red
, green
, blue
, light
);
714 static HRESULT WINAPI
d3drm2_CreateMaterial(IDirect3DRM2
*iface
,
715 D3DVALUE power
, IDirect3DRMMaterial
**material
)
717 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
719 TRACE("iface %p, power %.8e, material %p.\n", iface
, power
, material
);
721 return IDirect3DRM3_CreateMaterial(&d3drm
->IDirect3DRM3_iface
, power
, (IDirect3DRMMaterial2
**)material
);
724 static HRESULT WINAPI
d3drm2_CreateDevice(IDirect3DRM2
*iface
,
725 DWORD width
, DWORD height
, IDirect3DRMDevice2
**device
)
727 struct d3drm_device
*object
;
729 FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface
, width
, height
, device
);
731 hr
= d3drm_device_create(&object
);
735 *device
= IDirect3DRMDevice2_from_impl(object
);
740 static HRESULT WINAPI
d3drm2_CreateDeviceFromSurface(IDirect3DRM2
*iface
, GUID
*guid
,
741 IDirectDraw
*ddraw
, IDirectDrawSurface
*backbuffer
, IDirect3DRMDevice2
**device
)
743 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
744 IDirect3DRMDevice3
*device3
;
746 TRACE("iface %p, guid %s, ddraw %p, backbuffer %p, device %p.\n",
747 iface
, debugstr_guid(guid
), ddraw
, backbuffer
, device
);
750 return D3DRMERR_BADVALUE
;
752 hr
= IDirect3DRM3_CreateDeviceFromSurface(&d3drm
->IDirect3DRM3_iface
, guid
, ddraw
, backbuffer
, 0, &device3
);
756 hr
= IDirect3DRMDevice3_QueryInterface(device3
, &IID_IDirect3DRMDevice2
, (void**)device
);
757 IDirect3DRMDevice3_Release(device3
);
762 static HRESULT WINAPI
d3drm2_CreateDeviceFromD3D(IDirect3DRM2
*iface
,
763 IDirect3D2
*d3d
, IDirect3DDevice2
*d3d_device
, IDirect3DRMDevice2
**device
)
765 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
767 IDirect3DDevice
*d3d_device1
;
768 IDirect3DRMDevice
*device1
;
770 TRACE("iface %p, d3d %p, d3d_device %p, device %p.\n",
771 iface
, d3d
, d3d_device
, device
);
774 return D3DRMERR_BADVALUE
;
776 if (!d3d
|| !d3d_device
)
777 return D3DRMERR_BADVALUE
;
779 hr
= IDirect3D2_QueryInterface(d3d
, &IID_IDirect3D
, (void **)&d3d1
);
783 hr
= IDirect3DDevice2_QueryInterface(d3d_device
, &IID_IDirect3DDevice
, (void **)&d3d_device1
);
786 IDirect3D_Release(d3d1
);
790 hr
= IDirect3DRM_CreateDeviceFromD3D(&d3drm
->IDirect3DRM_iface
, d3d1
, d3d_device1
, &device1
);
791 IDirect3D_Release(d3d1
);
792 IDirect3DDevice_Release(d3d_device1
);
796 hr
= IDirect3DRMDevice_QueryInterface(device1
, &IID_IDirect3DRMDevice2
, (void **)device
);
797 IDirect3DRMDevice_Release(device1
);
802 static HRESULT WINAPI
d3drm2_CreateDeviceFromClipper(IDirect3DRM2
*iface
,
803 IDirectDrawClipper
*clipper
, GUID
*guid
, int width
, int height
,
804 IDirect3DRMDevice2
**device
)
806 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
807 IDirect3DRMDevice3
*device3
;
810 TRACE("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
811 iface
, clipper
, debugstr_guid(guid
), width
, height
, device
);
814 return D3DRMERR_BADVALUE
;
816 hr
= IDirect3DRM3_CreateDeviceFromClipper(&d3drm
->IDirect3DRM3_iface
, clipper
, guid
, width
, height
, &device3
);
820 hr
= IDirect3DRMDevice3_QueryInterface(device3
, &IID_IDirect3DRMDevice2
, (void**)device
);
821 IDirect3DRMDevice3_Release(device3
);
826 static HRESULT WINAPI
d3drm2_CreateTextureFromSurface(IDirect3DRM2
*iface
,
827 IDirectDrawSurface
*surface
, IDirect3DRMTexture2
**texture
)
829 FIXME("iface %p, surface %p, texture %p stub!\n", iface
, surface
, texture
);
834 static HRESULT WINAPI
d3drm2_CreateShadow(IDirect3DRM2
*iface
, IDirect3DRMVisual
*visual
,
835 IDirect3DRMLight
*light
, D3DVALUE px
, D3DVALUE py
, D3DVALUE pz
, D3DVALUE nx
, D3DVALUE ny
, D3DVALUE nz
,
836 IDirect3DRMVisual
**shadow
)
838 FIXME("iface %p, visual %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n",
839 iface
, visual
, light
, px
, py
, pz
, nx
, ny
, nz
, shadow
);
844 static HRESULT WINAPI
d3drm2_CreateViewport(IDirect3DRM2
*iface
, IDirect3DRMDevice
*device
,
845 IDirect3DRMFrame
*camera
, DWORD x
, DWORD y
, DWORD width
, DWORD height
, IDirect3DRMViewport
**viewport
)
847 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n",
848 iface
, device
, camera
, x
, y
, width
, height
, viewport
);
850 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport
, (IUnknown
**)viewport
);
853 static HRESULT WINAPI
d3drm2_CreateWrap(IDirect3DRM2
*iface
, D3DRMWRAPTYPE type
, IDirect3DRMFrame
*frame
,
854 D3DVALUE ox
, D3DVALUE oy
, D3DVALUE oz
, D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
,
855 D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
, D3DVALUE ou
, D3DVALUE ov
, D3DVALUE su
, D3DVALUE sv
,
856 IDirect3DRMWrap
**wrap
)
858 FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
859 "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
860 iface
, type
, frame
, ox
, oy
, oz
, dx
, dy
, dz
, ux
, uy
, uz
, ou
, ov
, su
, sv
, wrap
);
865 static HRESULT WINAPI
d3drm2_CreateUserVisual(IDirect3DRM2
*iface
,
866 D3DRMUSERVISUALCALLBACK cb
, void *ctx
, IDirect3DRMUserVisual
**visual
)
868 FIXME("iface %p, cb %p, ctx %p, visual %p stub!\n", iface
, cb
, ctx
, visual
);
873 static HRESULT WINAPI
d3drm2_LoadTexture(IDirect3DRM2
*iface
,
874 const char *filename
, IDirect3DRMTexture2
**texture
)
876 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
877 struct d3drm_texture
*object
;
880 FIXME("iface %p, filename %s, texture %p stub!\n", iface
, debugstr_a(filename
), texture
);
882 if (FAILED(hr
= d3drm_texture_create(&object
, &d3drm
->IDirect3DRM_iface
)))
885 *texture
= &object
->IDirect3DRMTexture2_iface
;
890 static HRESULT WINAPI
d3drm2_LoadTextureFromResource(IDirect3DRM2
*iface
, HMODULE module
,
891 const char *resource_name
, const char *resource_type
, IDirect3DRMTexture2
**texture
)
893 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
894 struct d3drm_texture
*object
;
897 FIXME("iface %p, resource_name %s, resource_type %s, texture %p stub!\n",
898 iface
, debugstr_a(resource_name
), debugstr_a(resource_type
), texture
);
900 if (FAILED(hr
= d3drm_texture_create(&object
, &d3drm
->IDirect3DRM_iface
)))
903 *texture
= &object
->IDirect3DRMTexture2_iface
;
908 static HRESULT WINAPI
d3drm2_SetSearchPath(IDirect3DRM2
*iface
, const char *path
)
910 FIXME("iface %p, path %s stub!\n", iface
, debugstr_a(path
));
915 static HRESULT WINAPI
d3drm2_AddSearchPath(IDirect3DRM2
*iface
, const char *path
)
917 FIXME("iface %p, path %s stub!\n", iface
, debugstr_a(path
));
922 static HRESULT WINAPI
d3drm2_GetSearchPath(IDirect3DRM2
*iface
, DWORD
*size
, char *path
)
924 FIXME("iface %p, size %p, path %p stub!\n", iface
, size
, path
);
929 static HRESULT WINAPI
d3drm2_SetDefaultTextureColors(IDirect3DRM2
*iface
, DWORD color_count
)
931 FIXME("iface %p, color_count %u stub!\n", iface
, color_count
);
936 static HRESULT WINAPI
d3drm2_SetDefaultTextureShades(IDirect3DRM2
*iface
, DWORD shade_count
)
938 FIXME("iface %p, shade_count %u stub!\n", iface
, shade_count
);
943 static HRESULT WINAPI
d3drm2_GetDevices(IDirect3DRM2
*iface
, IDirect3DRMDeviceArray
**array
)
945 FIXME("iface %p, array %p stub!\n", iface
, array
);
950 static HRESULT WINAPI
d3drm2_GetNamedObject(IDirect3DRM2
*iface
,
951 const char *name
, IDirect3DRMObject
**object
)
953 FIXME("iface %p, name %s, object %p stub!\n", iface
, debugstr_a(name
), object
);
958 static HRESULT WINAPI
d3drm2_EnumerateObjects(IDirect3DRM2
*iface
, D3DRMOBJECTCALLBACK cb
, void *ctx
)
960 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
965 static HRESULT WINAPI
d3drm2_Load(IDirect3DRM2
*iface
, void *source
, void *object_id
, IID
**iids
,
966 DWORD iid_count
, D3DRMLOADOPTIONS flags
, D3DRMLOADCALLBACK load_cb
, void *load_ctx
,
967 D3DRMLOADTEXTURECALLBACK load_tex_cb
, void *load_tex_ctx
, IDirect3DRMFrame
*parent_frame
)
969 struct d3drm
*d3drm
= impl_from_IDirect3DRM2(iface
);
970 IDirect3DRMFrame3
*parent_frame3
= NULL
;
971 HRESULT hr
= D3DRM_OK
;
973 TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, "
974 "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n",
975 iface
, source
, object_id
, iids
, iid_count
, flags
,
976 load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame
);
979 hr
= IDirect3DRMFrame_QueryInterface(parent_frame
, &IID_IDirect3DRMFrame3
, (void **)&parent_frame3
);
981 hr
= IDirect3DRM3_Load(&d3drm
->IDirect3DRM3_iface
, source
, object_id
, iids
, iid_count
,
982 flags
, load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame3
);
984 IDirect3DRMFrame3_Release(parent_frame3
);
989 static HRESULT WINAPI
d3drm2_Tick(IDirect3DRM2
*iface
, D3DVALUE tick
)
991 FIXME("iface %p, tick %.8e stub!\n", iface
, tick
);
996 static HRESULT WINAPI
d3drm2_CreateProgressiveMesh(IDirect3DRM2
*iface
, IDirect3DRMProgressiveMesh
**mesh
)
998 FIXME("iface %p, mesh %p stub!\n", iface
, mesh
);
1003 static const struct IDirect3DRM2Vtbl d3drm2_vtbl
=
1005 d3drm2_QueryInterface
,
1008 d3drm2_CreateObject
,
1011 d3drm2_CreateMeshBuilder
,
1013 d3drm2_CreateAnimation
,
1014 d3drm2_CreateAnimationSet
,
1015 d3drm2_CreateTexture
,
1017 d3drm2_CreateLightRGB
,
1018 d3drm2_CreateMaterial
,
1019 d3drm2_CreateDevice
,
1020 d3drm2_CreateDeviceFromSurface
,
1021 d3drm2_CreateDeviceFromD3D
,
1022 d3drm2_CreateDeviceFromClipper
,
1023 d3drm2_CreateTextureFromSurface
,
1024 d3drm2_CreateShadow
,
1025 d3drm2_CreateViewport
,
1027 d3drm2_CreateUserVisual
,
1029 d3drm2_LoadTextureFromResource
,
1030 d3drm2_SetSearchPath
,
1031 d3drm2_AddSearchPath
,
1032 d3drm2_GetSearchPath
,
1033 d3drm2_SetDefaultTextureColors
,
1034 d3drm2_SetDefaultTextureShades
,
1036 d3drm2_GetNamedObject
,
1037 d3drm2_EnumerateObjects
,
1040 d3drm2_CreateProgressiveMesh
,
1043 static HRESULT WINAPI
d3drm3_QueryInterface(IDirect3DRM3
*iface
, REFIID riid
, void **out
)
1045 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1047 return d3drm1_QueryInterface(&d3drm
->IDirect3DRM_iface
, riid
, out
);
1050 static ULONG WINAPI
d3drm3_AddRef(IDirect3DRM3
*iface
)
1052 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1053 ULONG refcount
= InterlockedIncrement(&d3drm
->ref3
);
1055 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
1058 InterlockedIncrement(&d3drm
->iface_count
);
1063 static ULONG WINAPI
d3drm3_Release(IDirect3DRM3
*iface
)
1065 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1066 ULONG refcount
= InterlockedDecrement(&d3drm
->ref3
);
1068 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
1070 if (!refcount
&& !InterlockedDecrement(&d3drm
->iface_count
))
1071 d3drm_destroy(d3drm
);
1076 static HRESULT WINAPI
d3drm3_CreateObject(IDirect3DRM3
*iface
,
1077 REFCLSID clsid
, IUnknown
*outer
, REFIID iid
, void **out
)
1079 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1083 TRACE("iface %p, clsid %s, outer %p, iid %s, out %p.\n",
1084 iface
, debugstr_guid(clsid
), outer
, debugstr_guid(iid
), out
);
1087 return D3DRMERR_BADVALUE
;
1092 return D3DRMERR_BADVALUE
;
1097 FIXME("COM aggregation for outer IUnknown (%p) not implemented. Returning E_NOTIMPL.\n", outer
);
1102 if (IsEqualGUID(clsid
, &CLSID_CDirect3DRMTexture
))
1104 struct d3drm_texture
*texture
;
1105 if (FAILED(hr
= d3drm_texture_create(&texture
, &d3drm
->IDirect3DRM_iface
)))
1110 object
= (IUnknown
*)&texture
->IDirect3DRMTexture3_iface
;
1114 FIXME("%s not implemented. Returning CLASSFACTORY_E_FIRST.\n", debugstr_guid(clsid
));
1116 return CLASSFACTORY_E_FIRST
;
1119 if (FAILED(hr
= IUnknown_QueryInterface(object
, iid
, out
)))
1121 IUnknown_Release(object
);
1126 static HRESULT WINAPI
d3drm3_CreateFrame(IDirect3DRM3
*iface
,
1127 IDirect3DRMFrame3
*parent
, IDirect3DRMFrame3
**frame
)
1129 TRACE("iface %p, parent %p, frame %p.\n", iface
, parent
, frame
);
1131 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3
, (IUnknown
*)parent
, (IUnknown
**)frame
);
1134 static HRESULT WINAPI
d3drm3_CreateMesh(IDirect3DRM3
*iface
, IDirect3DRMMesh
**mesh
)
1136 TRACE("iface %p, mesh %p.\n", iface
, mesh
);
1138 return Direct3DRMMesh_create(mesh
);
1141 static HRESULT WINAPI
d3drm3_CreateMeshBuilder(IDirect3DRM3
*iface
, IDirect3DRMMeshBuilder3
**mesh_builder
)
1143 TRACE("iface %p, mesh_builder %p.\n", iface
, mesh_builder
);
1145 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder3
, (IUnknown
**)mesh_builder
);
1148 static HRESULT WINAPI
d3drm3_CreateFace(IDirect3DRM3
*iface
, IDirect3DRMFace2
**face
)
1150 TRACE("iface %p, face %p.\n", iface
, face
);
1152 return Direct3DRMFace_create(&IID_IDirect3DRMFace2
, (IUnknown
**)face
);
1155 static HRESULT WINAPI
d3drm3_CreateAnimation(IDirect3DRM3
*iface
, IDirect3DRMAnimation2
**animation
)
1157 FIXME("iface %p, animation %p stub!\n", iface
, animation
);
1162 static HRESULT WINAPI
d3drm3_CreateAnimationSet(IDirect3DRM3
*iface
, IDirect3DRMAnimationSet2
**set
)
1164 FIXME("iface %p, set %p stub!\n", iface
, set
);
1169 static HRESULT WINAPI
d3drm3_CreateTexture(IDirect3DRM3
*iface
,
1170 D3DRMIMAGE
*image
, IDirect3DRMTexture3
**texture
)
1172 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1173 struct d3drm_texture
*object
;
1176 TRACE("iface %p, image %p, texture %p.\n", iface
, image
, texture
);
1179 return D3DRMERR_BADVALUE
;
1181 if (FAILED(hr
= d3drm_texture_create(&object
, &d3drm
->IDirect3DRM_iface
)))
1184 *texture
= &object
->IDirect3DRMTexture3_iface
;
1186 if (FAILED(IDirect3DRMTexture3_InitFromImage(*texture
, image
)))
1188 IDirect3DRMTexture3_Release(*texture
);
1190 return D3DRMERR_BADVALUE
;
1196 static HRESULT WINAPI
d3drm3_CreateLight(IDirect3DRM3
*iface
,
1197 D3DRMLIGHTTYPE type
, D3DCOLOR color
, IDirect3DRMLight
**light
)
1201 FIXME("iface %p, type %#x, color 0x%08x, light %p partial stub!\n", iface
, type
, color
, light
);
1203 if (SUCCEEDED(hr
= Direct3DRMLight_create((IUnknown
**)light
)))
1205 IDirect3DRMLight_SetType(*light
, type
);
1206 IDirect3DRMLight_SetColor(*light
, color
);
1212 static HRESULT WINAPI
d3drm3_CreateLightRGB(IDirect3DRM3
*iface
, D3DRMLIGHTTYPE type
,
1213 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
, IDirect3DRMLight
**light
)
1217 FIXME("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p partial stub!\n",
1218 iface
, type
, red
, green
, blue
, light
);
1220 if (SUCCEEDED(hr
= Direct3DRMLight_create((IUnknown
**)light
)))
1222 IDirect3DRMLight_SetType(*light
, type
);
1223 IDirect3DRMLight_SetColorRGB(*light
, red
, green
, blue
);
1229 static HRESULT WINAPI
d3drm3_CreateMaterial(IDirect3DRM3
*iface
,
1230 D3DVALUE power
, IDirect3DRMMaterial2
**material
)
1234 TRACE("iface %p, power %.8e, material %p.\n", iface
, power
, material
);
1236 if (SUCCEEDED(hr
= Direct3DRMMaterial_create(material
)))
1237 IDirect3DRMMaterial2_SetPower(*material
, power
);
1242 static HRESULT WINAPI
d3drm3_CreateDevice(IDirect3DRM3
*iface
,
1243 DWORD width
, DWORD height
, IDirect3DRMDevice3
**device
)
1245 struct d3drm_device
*object
;
1247 FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface
, width
, height
, device
);
1249 hr
= d3drm_device_create(&object
);
1253 *device
= IDirect3DRMDevice3_from_impl(object
);
1258 static HRESULT WINAPI
d3drm3_CreateDeviceFromSurface(IDirect3DRM3
*iface
, GUID
*guid
,
1259 IDirectDraw
*ddraw
, IDirectDrawSurface
*backbuffer
, DWORD flags
, IDirect3DRMDevice3
**device
)
1261 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1262 struct d3drm_device
*object
;
1266 TRACE("iface %p, guid %s, ddraw %p, backbuffer %p, flags %#x, device %p.\n",
1267 iface
, debugstr_guid(guid
), ddraw
, backbuffer
, flags
, device
);
1270 return D3DRMERR_BADVALUE
;
1273 if (!backbuffer
|| !ddraw
)
1274 return D3DRMERR_BADDEVICE
;
1276 hr
= d3drm_device_create(&object
);
1280 use_z_surface
= !(flags
& D3DRMDEVICE_NOZBUFFER
);
1282 hr
= d3drm_device_init(object
, 3, &d3drm
->IDirect3DRM_iface
, ddraw
, backbuffer
, use_z_surface
);
1284 *device
= IDirect3DRMDevice3_from_impl(object
);
1286 d3drm_device_destroy(object
);
1291 static HRESULT WINAPI
d3drm3_CreateDeviceFromD3D(IDirect3DRM3
*iface
,
1292 IDirect3D2
*d3d
, IDirect3DDevice2
*d3d_device
, IDirect3DRMDevice3
**device
)
1294 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1296 IDirect3DDevice
*d3d_device1
;
1297 IDirect3DRMDevice
*device1
;
1299 TRACE("iface %p, d3d %p, d3d_device %p, device %p.\n",
1300 iface
, d3d
, d3d_device
, device
);
1303 return D3DRMERR_BADVALUE
;
1305 if (!d3d
|| !d3d_device
)
1306 return D3DRMERR_BADVALUE
;
1308 hr
= IDirect3D2_QueryInterface(d3d
, &IID_IDirect3D
, (void **)&d3d1
);
1311 hr
= IDirect3DDevice2_QueryInterface(d3d_device
, &IID_IDirect3DDevice
, (void **)&d3d_device1
);
1314 IDirect3D_Release(d3d1
);
1318 hr
= IDirect3DRM_CreateDeviceFromD3D(&d3drm
->IDirect3DRM_iface
, d3d1
, d3d_device1
, &device1
);
1319 IDirect3D_Release(d3d1
);
1320 IDirect3DDevice_Release(d3d_device1
);
1324 hr
= IDirect3DRMDevice_QueryInterface(device1
, &IID_IDirect3DRMDevice3
, (void **)device
);
1325 IDirect3DRMDevice_Release(device1
);
1330 static HRESULT WINAPI
d3drm3_CreateDeviceFromClipper(IDirect3DRM3
*iface
,
1331 IDirectDrawClipper
*clipper
, GUID
*guid
, int width
, int height
,
1332 IDirect3DRMDevice3
**device
)
1334 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1335 struct d3drm_device
*object
;
1337 IDirectDrawSurface
*render_target
;
1340 TRACE("iface %p, clipper %p, guid %s, width %d, height %d, device %p.\n",
1341 iface
, clipper
, debugstr_guid(guid
), width
, height
, device
);
1344 return D3DRMERR_BADVALUE
;
1347 if (!clipper
|| !width
|| !height
)
1348 return D3DRMERR_BADVALUE
;
1350 hr
= DirectDrawCreate(NULL
, &ddraw
, NULL
);
1354 hr
= d3drm_device_create(&object
);
1357 IDirectDraw_Release(ddraw
);
1361 hr
= d3drm_device_create_surfaces_from_clipper(object
, ddraw
, clipper
, width
, height
, &render_target
);
1364 IDirectDraw_Release(ddraw
);
1365 d3drm_device_destroy(object
);
1369 hr
= d3drm_device_init(object
, 3, &d3drm
->IDirect3DRM_iface
, ddraw
, render_target
, TRUE
);
1370 IDirectDraw_Release(ddraw
);
1371 IDirectDrawSurface_Release(render_target
);
1373 d3drm_device_destroy(object
);
1375 *device
= IDirect3DRMDevice3_from_impl(object
);
1380 static HRESULT WINAPI
d3drm3_CreateShadow(IDirect3DRM3
*iface
, IUnknown
*object
, IDirect3DRMLight
*light
,
1381 D3DVALUE px
, D3DVALUE py
, D3DVALUE pz
, D3DVALUE nx
, D3DVALUE ny
, D3DVALUE nz
, IDirect3DRMShadow2
**shadow
)
1383 FIXME("iface %p, object %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n",
1384 iface
, object
, light
, px
, py
, pz
, nx
, ny
, nz
, shadow
);
1389 static HRESULT WINAPI
d3drm3_CreateTextureFromSurface(IDirect3DRM3
*iface
,
1390 IDirectDrawSurface
*surface
, IDirect3DRMTexture3
**texture
)
1392 FIXME("iface %p, surface %p, texture %p stub!\n", iface
, surface
, texture
);
1397 static HRESULT WINAPI
d3drm3_CreateViewport(IDirect3DRM3
*iface
, IDirect3DRMDevice3
*device
,
1398 IDirect3DRMFrame3
*camera
, DWORD x
, DWORD y
, DWORD width
, DWORD height
, IDirect3DRMViewport2
**viewport
)
1400 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n",
1401 iface
, device
, camera
, x
, y
, width
, height
, viewport
);
1403 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport2
, (IUnknown
**)viewport
);
1406 static HRESULT WINAPI
d3drm3_CreateWrap(IDirect3DRM3
*iface
, D3DRMWRAPTYPE type
, IDirect3DRMFrame3
*frame
,
1407 D3DVALUE ox
, D3DVALUE oy
, D3DVALUE oz
, D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
,
1408 D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
, D3DVALUE ou
, D3DVALUE ov
, D3DVALUE su
, D3DVALUE sv
,
1409 IDirect3DRMWrap
**wrap
)
1411 FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
1412 "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
1413 iface
, type
, frame
, ox
, oy
, oz
, dx
, dy
, dz
, ux
, uy
, uz
, ou
, ov
, su
, sv
, wrap
);
1418 static HRESULT WINAPI
d3drm3_CreateUserVisual(IDirect3DRM3
*iface
,
1419 D3DRMUSERVISUALCALLBACK cb
, void *ctx
, IDirect3DRMUserVisual
**visual
)
1421 FIXME("iface %p, cb %p, ctx %p, visual %p stub!\n", iface
, cb
, ctx
, visual
);
1426 static HRESULT WINAPI
d3drm3_LoadTexture(IDirect3DRM3
*iface
,
1427 const char *filename
, IDirect3DRMTexture3
**texture
)
1429 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1430 struct d3drm_texture
*object
;
1433 FIXME("iface %p, filename %s, texture %p stub!\n", iface
, debugstr_a(filename
), texture
);
1435 if (FAILED(hr
= d3drm_texture_create(&object
, &d3drm
->IDirect3DRM_iface
)))
1438 *texture
= &object
->IDirect3DRMTexture3_iface
;
1443 static HRESULT WINAPI
d3drm3_LoadTextureFromResource(IDirect3DRM3
*iface
, HMODULE module
,
1444 const char *resource_name
, const char *resource_type
, IDirect3DRMTexture3
**texture
)
1446 struct d3drm
*d3drm
= impl_from_IDirect3DRM3(iface
);
1447 struct d3drm_texture
*object
;
1450 FIXME("iface %p, module %p, resource_name %s, resource_type %s, texture %p stub!\n",
1451 iface
, module
, debugstr_a(resource_name
), debugstr_a(resource_type
), texture
);
1453 if (FAILED(hr
= d3drm_texture_create(&object
, &d3drm
->IDirect3DRM_iface
)))
1456 *texture
= &object
->IDirect3DRMTexture3_iface
;
1461 static HRESULT WINAPI
d3drm3_SetSearchPath(IDirect3DRM3
*iface
, const char *path
)
1463 FIXME("iface %p, path %s stub!\n", iface
, debugstr_a(path
));
1468 static HRESULT WINAPI
d3drm3_AddSearchPath(IDirect3DRM3
*iface
, const char *path
)
1470 FIXME("iface %p, path %s stub!\n", iface
, debugstr_a(path
));
1475 static HRESULT WINAPI
d3drm3_GetSearchPath(IDirect3DRM3
*iface
, DWORD
*size
, char *path
)
1477 FIXME("iface %p, size %p, path %p stub!\n", iface
, size
, path
);
1482 static HRESULT WINAPI
d3drm3_SetDefaultTextureColors(IDirect3DRM3
*iface
, DWORD color_count
)
1484 FIXME("iface %p, color_count %u stub!\n", iface
, color_count
);
1489 static HRESULT WINAPI
d3drm3_SetDefaultTextureShades(IDirect3DRM3
*iface
, DWORD shade_count
)
1491 FIXME("iface %p, shade_count %u stub!\n", iface
, shade_count
);
1496 static HRESULT WINAPI
d3drm3_GetDevices(IDirect3DRM3
*iface
, IDirect3DRMDeviceArray
**array
)
1498 FIXME("iface %p, array %p stub!\n", iface
, array
);
1503 static HRESULT WINAPI
d3drm3_GetNamedObject(IDirect3DRM3
*iface
,
1504 const char *name
, IDirect3DRMObject
**object
)
1506 FIXME("iface %p, name %s, object %p stub!\n", iface
, debugstr_a(name
), object
);
1511 static HRESULT WINAPI
d3drm3_EnumerateObjects(IDirect3DRM3
*iface
, D3DRMOBJECTCALLBACK cb
, void *ctx
)
1513 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
1518 static HRESULT
load_data(IDirect3DRM3
*iface
, IDirectXFileData
*data_object
, IID
**GUIDs
, DWORD nb_GUIDs
, D3DRMLOADCALLBACK LoadProc
,
1519 void *ArgLP
, D3DRMLOADTEXTURECALLBACK LoadTextureProc
, void *ArgLTP
, IDirect3DRMFrame3
*parent_frame
)
1521 HRESULT ret
= D3DRMERR_BADOBJECT
;
1525 BOOL requested
= FALSE
;
1527 hr
= IDirectXFileData_GetType(data_object
, &guid
);
1528 if (hr
!= DXFILE_OK
)
1531 TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid
));
1533 /* Load object only if it is top level and requested or if it is part of another object */
1535 if (IsEqualGUID(guid
, &TID_D3DRMMesh
))
1537 TRACE("Found TID_D3DRMMesh\n");
1539 for (i
= 0; i
< nb_GUIDs
; i
++)
1540 if (IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMMeshBuilder
) ||
1541 IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMMeshBuilder2
) ||
1542 IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMMeshBuilder3
))
1548 if (requested
|| parent_frame
)
1550 IDirect3DRMMeshBuilder3
*meshbuilder
;
1552 TRACE("Load mesh data\n");
1554 hr
= IDirect3DRM3_CreateMeshBuilder(iface
, &meshbuilder
);
1557 hr
= load_mesh_data(meshbuilder
, data_object
, LoadTextureProc
, ArgLTP
);
1560 /* Only top level objects are notified */
1563 IDirect3DRMObject
*object
;
1565 hr
= IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder
, GUIDs
[i
], (void**)&object
);
1568 LoadProc(object
, GUIDs
[i
], ArgLP
);
1569 IDirect3DRMObject_Release(object
);
1574 IDirect3DRMFrame3_AddVisual(parent_frame
, (IUnknown
*)meshbuilder
);
1577 IDirect3DRMMeshBuilder3_Release(meshbuilder
);
1581 ERR("Cannot process mesh\n");
1584 else if (IsEqualGUID(guid
, &TID_D3DRMFrame
))
1586 TRACE("Found TID_D3DRMFrame\n");
1588 for (i
= 0; i
< nb_GUIDs
; i
++)
1589 if (IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMFrame
) ||
1590 IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMFrame2
) ||
1591 IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMFrame3
))
1597 if (requested
|| parent_frame
)
1599 IDirect3DRMFrame3
*frame
;
1601 TRACE("Load frame data\n");
1603 hr
= IDirect3DRM3_CreateFrame(iface
, parent_frame
, &frame
);
1606 IDirectXFileObject
*child
;
1608 while (SUCCEEDED(hr
= IDirectXFileData_GetNextObject(data_object
, &child
)))
1610 IDirectXFileData
*data
;
1611 IDirectXFileDataReference
*reference
;
1612 IDirectXFileBinary
*binary
;
1614 if (SUCCEEDED(IDirectXFileObject_QueryInterface(child
,
1615 &IID_IDirectXFileBinary
, (void **)&binary
)))
1617 FIXME("Binary Object not supported yet\n");
1618 IDirectXFileBinary_Release(binary
);
1620 else if (SUCCEEDED(IDirectXFileObject_QueryInterface(child
,
1621 &IID_IDirectXFileData
, (void **)&data
)))
1623 TRACE("Found Data Object\n");
1624 hr
= load_data(iface
, data
, GUIDs
, nb_GUIDs
, LoadProc
, ArgLP
, LoadTextureProc
, ArgLTP
, frame
);
1625 IDirectXFileData_Release(data
);
1627 else if (SUCCEEDED(IDirectXFileObject_QueryInterface(child
,
1628 &IID_IDirectXFileDataReference
, (void **)&reference
)))
1630 TRACE("Found Data Object Reference\n");
1631 IDirectXFileDataReference_Resolve(reference
, &data
);
1632 hr
= load_data(iface
, data
, GUIDs
, nb_GUIDs
, LoadProc
, ArgLP
, LoadTextureProc
, ArgLTP
, frame
);
1633 IDirectXFileData_Release(data
);
1634 IDirectXFileDataReference_Release(reference
);
1636 IDirectXFileObject_Release(child
);
1639 if (hr
!= DXFILEERR_NOMOREOBJECTS
)
1641 IDirect3DRMFrame3_Release(frame
);
1646 /* Only top level objects are notified */
1649 IDirect3DRMObject
*object
;
1651 hr
= IDirect3DRMFrame3_QueryInterface(frame
, GUIDs
[i
], (void**)&object
);
1654 LoadProc(object
, GUIDs
[i
], ArgLP
);
1655 IDirect3DRMObject_Release(object
);
1658 IDirect3DRMFrame3_Release(frame
);
1662 ERR("Cannot process frame\n");
1665 else if (IsEqualGUID(guid
, &TID_D3DRMMaterial
))
1667 TRACE("Found TID_D3DRMMaterial\n");
1669 /* Cannot be requested so nothing to do */
1671 else if (IsEqualGUID(guid
, &TID_D3DRMFrameTransformMatrix
))
1673 TRACE("Found TID_D3DRMFrameTransformMatrix\n");
1675 /* Cannot be requested */
1678 D3DRMMATRIX4D
*matrix
;
1681 TRACE("Load Frame Transform Matrix data\n");
1683 hr
= IDirectXFileData_GetData(data_object
, NULL
, &size
, (void**)&matrix
);
1684 if ((hr
!= DXFILE_OK
) || (size
!= sizeof(matrix
)))
1687 hr
= IDirect3DRMFrame3_AddTransform(parent_frame
, D3DRMCOMBINE_REPLACE
, *matrix
);
1694 FIXME("Found unknown TID %s\n", debugstr_guid(guid
));
1704 static HRESULT WINAPI
d3drm3_Load(IDirect3DRM3
*iface
, void *source
, void *object_id
, IID
**iids
,
1705 DWORD iid_count
, D3DRMLOADOPTIONS flags
, D3DRMLOADCALLBACK load_cb
, void *load_ctx
,
1706 D3DRMLOADTEXTURECALLBACK load_tex_cb
, void *load_tex_ctx
, IDirect3DRMFrame3
*parent_frame
)
1708 DXFILELOADOPTIONS load_options
;
1709 IDirectXFile
*file
= NULL
;
1710 IDirectXFileEnumObject
*enum_object
= NULL
;
1711 IDirectXFileData
*data
= NULL
;
1715 struct d3drm_file_header
*header
;
1716 HRESULT ret
= D3DRMERR_BADOBJECT
;
1719 TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, "
1720 "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n",
1721 iface
, source
, object_id
, iids
, iid_count
, flags
,
1722 load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame
);
1724 TRACE("Looking for GUIDs:\n");
1725 for (i
= 0; i
< iid_count
; ++i
)
1726 TRACE("- %s (%s)\n", debugstr_guid(iids
[i
]), get_IID_string(iids
[i
]));
1728 if (flags
== D3DRMLOAD_FROMMEMORY
)
1730 load_options
= DXFILELOAD_FROMMEMORY
;
1732 else if (flags
== D3DRMLOAD_FROMFILE
)
1734 load_options
= DXFILELOAD_FROMFILE
;
1735 TRACE("Loading from file %s\n", debugstr_a(source
));
1739 FIXME("Load options %#x not supported yet.\n", flags
);
1743 hr
= DirectXFileCreate(&file
);
1744 if (hr
!= DXFILE_OK
)
1747 hr
= IDirectXFile_RegisterTemplates(file
, templates
, strlen(templates
));
1748 if (hr
!= DXFILE_OK
)
1751 hr
= IDirectXFile_CreateEnumObject(file
, source
, load_options
, &enum_object
);
1752 if (hr
!= DXFILE_OK
)
1755 hr
= IDirectXFileEnumObject_GetNextDataObject(enum_object
, &data
);
1756 if (hr
!= DXFILE_OK
)
1759 hr
= IDirectXFileData_GetType(data
, &pGuid
);
1760 if (hr
!= DXFILE_OK
)
1763 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid
));
1765 if (!IsEqualGUID(pGuid
, &TID_DXFILEHeader
))
1767 ret
= D3DRMERR_BADFILE
;
1771 hr
= IDirectXFileData_GetData(data
, NULL
, &size
, (void **)&header
);
1772 if ((hr
!= DXFILE_OK
) || (size
!= sizeof(*header
)))
1775 TRACE("Version is %u.%u, flags %#x.\n", header
->major
, header
->minor
, header
->flags
);
1777 /* Version must be 1.0.x */
1778 if ((header
->major
!= 1) || (header
->minor
!= 0))
1780 ret
= D3DRMERR_BADFILE
;
1784 IDirectXFileData_Release(data
);
1789 hr
= IDirectXFileEnumObject_GetNextDataObject(enum_object
, &data
);
1790 if (hr
== DXFILEERR_NOMOREOBJECTS
)
1792 TRACE("No more object\n");
1795 else if (hr
!= DXFILE_OK
)
1797 ret
= D3DRMERR_BADFILE
;
1801 ret
= load_data(iface
, data
, iids
, iid_count
, load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame
);
1802 if (ret
!= D3DRM_OK
)
1805 IDirectXFileData_Release(data
);
1813 IDirectXFileData_Release(data
);
1815 IDirectXFileEnumObject_Release(enum_object
);
1817 IDirectXFile_Release(file
);
1822 static HRESULT WINAPI
d3drm3_Tick(IDirect3DRM3
*iface
, D3DVALUE tick
)
1824 FIXME("iface %p, tick %.8e stub!\n", iface
, tick
);
1829 static HRESULT WINAPI
d3drm3_CreateProgressiveMesh(IDirect3DRM3
*iface
, IDirect3DRMProgressiveMesh
**mesh
)
1831 FIXME("iface %p, mesh %p stub!\n", iface
, mesh
);
1836 static HRESULT WINAPI
d3drm3_RegisterClient(IDirect3DRM3
*iface
, REFGUID guid
, DWORD
*id
)
1838 FIXME("iface %p, guid %s, id %p stub!\n", iface
, debugstr_guid(guid
), id
);
1843 static HRESULT WINAPI
d3drm3_UnregisterClient(IDirect3DRM3
*iface
, REFGUID guid
)
1845 FIXME("iface %p, guid %s stub!\n", iface
, debugstr_guid(guid
));
1850 static HRESULT WINAPI
d3drm3_CreateClippedVisual(IDirect3DRM3
*iface
,
1851 IDirect3DRMVisual
*visual
, IDirect3DRMClippedVisual
**clipped_visual
)
1853 FIXME("iface %p, visual %p, clipped_visual %p stub!\n", iface
, visual
, clipped_visual
);
1858 static HRESULT WINAPI
d3drm3_SetOptions(IDirect3DRM3
*iface
, DWORD flags
)
1860 FIXME("iface %p, flags %#x stub!\n", iface
, flags
);
1865 static HRESULT WINAPI
d3drm3_GetOptions(IDirect3DRM3
*iface
, DWORD
*flags
)
1867 FIXME("iface %p, flags %p stub!\n", iface
, flags
);
1872 static const struct IDirect3DRM3Vtbl d3drm3_vtbl
=
1874 d3drm3_QueryInterface
,
1877 d3drm3_CreateObject
,
1880 d3drm3_CreateMeshBuilder
,
1882 d3drm3_CreateAnimation
,
1883 d3drm3_CreateAnimationSet
,
1884 d3drm3_CreateTexture
,
1886 d3drm3_CreateLightRGB
,
1887 d3drm3_CreateMaterial
,
1888 d3drm3_CreateDevice
,
1889 d3drm3_CreateDeviceFromSurface
,
1890 d3drm3_CreateDeviceFromD3D
,
1891 d3drm3_CreateDeviceFromClipper
,
1892 d3drm3_CreateTextureFromSurface
,
1893 d3drm3_CreateShadow
,
1894 d3drm3_CreateViewport
,
1896 d3drm3_CreateUserVisual
,
1898 d3drm3_LoadTextureFromResource
,
1899 d3drm3_SetSearchPath
,
1900 d3drm3_AddSearchPath
,
1901 d3drm3_GetSearchPath
,
1902 d3drm3_SetDefaultTextureColors
,
1903 d3drm3_SetDefaultTextureShades
,
1905 d3drm3_GetNamedObject
,
1906 d3drm3_EnumerateObjects
,
1909 d3drm3_CreateProgressiveMesh
,
1910 d3drm3_RegisterClient
,
1911 d3drm3_UnregisterClient
,
1912 d3drm3_CreateClippedVisual
,
1917 HRESULT WINAPI
Direct3DRMCreate(IDirect3DRM
**d3drm
)
1919 struct d3drm
*object
;
1921 TRACE("d3drm %p.\n", d3drm
);
1923 if (!(object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
))))
1924 return E_OUTOFMEMORY
;
1926 object
->IDirect3DRM_iface
.lpVtbl
= &d3drm1_vtbl
;
1927 object
->IDirect3DRM2_iface
.lpVtbl
= &d3drm2_vtbl
;
1928 object
->IDirect3DRM3_iface
.lpVtbl
= &d3drm3_vtbl
;
1930 object
->iface_count
= 1;
1932 *d3drm
= &object
->IDirect3DRM_iface
;
1937 HRESULT WINAPI
DllCanUnloadNow(void)
1942 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, void **ppv
)
1944 TRACE("(%s, %s, %p): stub\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
1947 return E_INVALIDARG
;
1949 return CLASS_E_CLASSNOTAVAILABLE
;