[PATCH 1/3] d3drm: Add stubs for IDirect3DRMFrame interface. (v2)

Aaryaman Vasishta jem456.vasishta at gmail.com
Thu Jun 9 17:18:45 CDT 2016


Signed-off-by: Aaryaman Vasishta <jem456.vasishta at gmail.com>
---
 dlls/d3drm/frame.c       | 677 ++++++++++++++++++++++++++++++++++++++++++++++-
 dlls/d3drm/tests/d3drm.c |  10 +
 2 files changed, 685 insertions(+), 2 deletions(-)

diff --git a/dlls/d3drm/frame.c b/dlls/d3drm/frame.c
index f20040b..721643c 100644
--- a/dlls/d3drm/frame.c
+++ b/dlls/d3drm/frame.c
@@ -40,6 +40,7 @@ static D3DRMMATRIX4D identity = {
 
 struct d3drm_frame
 {
+    IDirect3DRMFrame IDirect3DRMFrame_iface;
     IDirect3DRMFrame2 IDirect3DRMFrame2_iface;
     IDirect3DRMFrame3 IDirect3DRMFrame3_iface;
     LONG ref;
@@ -81,6 +82,11 @@ struct d3drm_light_array
     IDirect3DRMLight **lights;
 };
 
+static inline struct d3drm_frame *impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
+{
+    return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame_iface);
+}
+
 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface)
 {
     return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame2_iface);
@@ -464,6 +470,669 @@ static struct d3drm_light_array *d3drm_light_array_create(unsigned int light_cou
     return array;
 }
 
+static HRESULT WINAPI d3drm_frame1_QueryInterface(IDirect3DRMFrame *iface, REFIID riid, void **out)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
+
+    return IDirect3DRMFrame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
+}
+
+static ULONG WINAPI d3drm_frame1_AddRef(IDirect3DRMFrame *iface)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p.\n", iface);
+
+    return IDirect3DRMFrame3_AddRef(&frame->IDirect3DRMFrame3_iface);
+}
+
+static ULONG WINAPI d3drm_frame1_Release(IDirect3DRMFrame *iface)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p.\n", iface);
+
+    return IDirect3DRMFrame3_Release(&frame->IDirect3DRMFrame3_iface);
+}
+
+static HRESULT WINAPI d3drm_frame1_Clone(IDirect3DRMFrame *iface,
+        IUnknown *outer, REFIID iid, void **out)
+{
+    FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_AddDestroyCallback(IDirect3DRMFrame *iface,
+        D3DRMOBJECTCALLBACK cb, void *ctx)
+{
+    FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_DeleteDestroyCallback(IDirect3DRMFrame *iface,
+        D3DRMOBJECTCALLBACK cb, void *ctx)
+{
+    FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetAppData(IDirect3DRMFrame *iface, DWORD data)
+{
+    FIXME("iface %p, data %#x stub!\n", iface, data);
+
+    return E_NOTIMPL;
+}
+
+static DWORD WINAPI d3drm_frame1_GetAppData(IDirect3DRMFrame *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return 0;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetName(IDirect3DRMFrame *iface, const char *name)
+{
+    FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetName(IDirect3DRMFrame *iface, DWORD *size, char *name)
+{
+    FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetClassName(IDirect3DRMFrame *iface, DWORD *size, char *name)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, size %p, name %p.\n", iface, size, name);
+
+    return IDirect3DRMFrame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
+}
+
+static HRESULT WINAPI d3drm_frame1_AddChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+    IDirect3DRMFrame3 *child3;
+    HRESULT hr;
+
+    TRACE("iface %p, child %p.\n", iface, child);
+
+    if (!child)
+        return D3DRMERR_BADOBJECT;
+    hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3);
+    if (hr != S_OK)
+        return D3DRMERR_BADOBJECT;
+    IDirect3DRMFrame_Release(child);
+
+    return IDirect3DRMFrame3_AddChild(&frame->IDirect3DRMFrame3_iface, child3);
+}
+
+static HRESULT WINAPI d3drm_frame1_AddLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, light %p.\n", iface, light);
+
+    return IDirect3DRMFrame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
+}
+
+static HRESULT WINAPI d3drm_frame1_AddMoveCallback(IDirect3DRMFrame *iface,
+        D3DRMFRAMEMOVECALLBACK cb, void *ctx)
+{
+    FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_AddTransform(IDirect3DRMFrame *iface, D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
+
+    return IDirect3DRMFrame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
+}
+
+static HRESULT WINAPI d3drm_frame1_AddTranslation(IDirect3DRMFrame *iface,
+        D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
+{
+    FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_AddScale(IDirect3DRMFrame *iface,
+        D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
+{
+    FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_AddRotation(IDirect3DRMFrame *iface,
+        D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
+{
+    FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_AddVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, visual %p.\n", iface, visual);
+
+    return IDirect3DRMFrame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
+}
+
+static HRESULT WINAPI d3drm_frame1_GetChildren(IDirect3DRMFrame *iface, IDirect3DRMFrameArray **children)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, children %p.\n", iface, children);
+
+    return IDirect3DRMFrame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
+}
+
+static D3DCOLOR WINAPI d3drm_frame1_GetColor(IDirect3DRMFrame *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return 0;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetLights(IDirect3DRMFrame *iface, IDirect3DRMLightArray **lights)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, lights %p.\n", iface, lights);
+
+    return IDirect3DRMFrame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
+}
+
+static D3DRMMATERIALMODE WINAPI d3drm_frame1_GetMaterialMode(IDirect3DRMFrame *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return D3DRMMATERIAL_FROMPARENT;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetParent(IDirect3DRMFrame *iface, IDirect3DRMFrame **parent)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, parent %p.\n", iface, parent);
+
+    if (!parent)
+        return D3DRMERR_BADVALUE;
+
+    if (frame->parent)
+    {
+        *parent = (IDirect3DRMFrame *)&frame->parent->IDirect3DRMFrame_iface;
+        IDirect3DRMFrame_AddRef(*parent);
+    }
+    else
+    {
+        *parent = NULL;
+    }
+
+    return D3DRM_OK;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetPosition(IDirect3DRMFrame *iface,
+        IDirect3DRMFrame *reference, D3DVECTOR *position)
+{
+    FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetRotation(IDirect3DRMFrame *iface,
+        IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
+{
+    FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetScene(IDirect3DRMFrame *iface, IDirect3DRMFrame **scene)
+{
+    FIXME("iface %p, scene %p stub!\n", iface, scene);
+
+    return E_NOTIMPL;
+}
+
+static D3DRMSORTMODE WINAPI d3drm_frame1_GetSortMode(IDirect3DRMFrame *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return D3DRMSORT_FROMPARENT;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture **texture)
+{
+    FIXME("iface %p, texture %p stub!\n", iface, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetTransform(IDirect3DRMFrame *iface, D3DRMMATRIX4D matrix)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, matrix %p.\n", iface, matrix);
+
+    memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
+
+    return D3DRM_OK;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetVelocity(IDirect3DRMFrame *iface,
+        IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
+{
+    FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
+        iface, reference, velocity, with_rotation);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetOrientation(IDirect3DRMFrame *iface,
+        IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
+{
+    FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetVisuals(IDirect3DRMFrame *iface, IDirect3DRMVisualArray **visuals)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+    struct d3drm_visual_array *array;
+
+    TRACE("iface %p, visuals %p.\n", iface, visuals);
+
+    if (!visuals)
+        return D3DRMERR_BADVALUE;
+
+    if (!(array = d3drm_visual_array_create(frame->nb_visuals, frame->visuals)))
+        return E_OUTOFMEMORY;
+
+    *visuals = &array->IDirect3DRMVisualArray_iface;
+
+    return D3DRM_OK;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetTextureTopology(IDirect3DRMFrame *iface, BOOL *wrap_u, BOOL *wrap_v)
+{
+    FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_InverseTransform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
+{
+    FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_Load(IDirect3DRMFrame *iface, void *filename,
+        void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
+{
+    FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
+        iface, filename, name, flags, cb, ctx);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_LookAt(IDirect3DRMFrame *iface, IDirect3DRMFrame *target,
+        IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
+{
+    FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_Move(IDirect3DRMFrame *iface, D3DVALUE delta)
+{
+    FIXME("iface %p, delta %.8e stub!\n", iface, delta);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_DeleteChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+    IDirect3DRMFrame3 *child3;
+    HRESULT hr;
+
+    TRACE("iface %p, child %p.\n", iface, child);
+
+    if (!child)
+        return D3DRMERR_BADOBJECT;
+    if (FAILED(hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3)))
+        return D3DRMERR_BADOBJECT;
+    IDirect3DRMFrame_Release(child);
+
+    return IDirect3DRMFrame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, child3);
+}
+
+static HRESULT WINAPI d3drm_frame1_DeleteLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, light %p.\n", iface, light);
+
+    return IDirect3DRMFrame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
+}
+
+static HRESULT WINAPI d3drm_frame1_DeleteMoveCallback(IDirect3DRMFrame *iface,
+        D3DRMFRAMEMOVECALLBACK cb, void *ctx)
+{
+    FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_DeleteVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, visual %p.\n", iface, visual);
+
+    return IDirect3DRMFrame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
+}
+
+static D3DCOLOR WINAPI d3drm_frame1_GetSceneBackground(IDirect3DRMFrame *iface)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p.\n", iface);
+
+    return IDirect3DRMFrame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
+}
+
+static HRESULT WINAPI d3drm_frame1_GetSceneBackgroundDepth(IDirect3DRMFrame *iface,
+        IDirectDrawSurface **surface)
+{
+    FIXME("iface %p, surface %p stub!\n", iface, surface);
+
+    return E_NOTIMPL;
+}
+
+static D3DCOLOR WINAPI d3drm_frame1_GetSceneFogColor(IDirect3DRMFrame *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return 0;
+}
+
+static BOOL WINAPI d3drm_frame1_GetSceneFogEnable(IDirect3DRMFrame *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return FALSE;
+}
+
+static D3DRMFOGMODE WINAPI d3drm_frame1_GetSceneFogMode(IDirect3DRMFrame *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return D3DRMFOG_LINEAR;
+}
+
+static HRESULT WINAPI d3drm_frame1_GetSceneFogParams(IDirect3DRMFrame *iface,
+        D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
+{
+    FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetSceneBackground(IDirect3DRMFrame *iface, D3DCOLOR color)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, color 0x%08x.\n", iface, color);
+
+    return IDirect3DRMFrame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
+}
+
+static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundRGB(IDirect3DRMFrame *iface,
+        D3DVALUE red, D3DVALUE green, D3DVALUE blue)
+{
+    struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
+
+    TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
+
+    return IDirect3DRMFrame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
+}
+
+static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundDepth(IDirect3DRMFrame *iface, IDirectDrawSurface *surface)
+{
+    FIXME("iface %p, surface %p stub!\n", iface, surface);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundImage(IDirect3DRMFrame *iface, IDirect3DRMTexture *texture)
+{
+    FIXME("iface %p, texture %p stub!\n", iface, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetSceneFogEnable(IDirect3DRMFrame *iface, BOOL enable)
+{
+    FIXME("iface %p, enable %#x stub!\n", iface, enable);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetSceneFogColor(IDirect3DRMFrame *iface, D3DCOLOR color)
+{
+    FIXME("iface %p, color 0x%08x stub!\n", iface, color);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetSceneFogMode(IDirect3DRMFrame *iface, D3DRMFOGMODE mode)
+{
+    FIXME("iface %p, mode %#x stub!\n", iface, mode);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetSceneFogParams(IDirect3DRMFrame *iface,
+        D3DVALUE start, D3DVALUE end, D3DVALUE density)
+{
+    FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetColor(IDirect3DRMFrame *iface, D3DCOLOR color)
+{
+    FIXME("iface %p, color 0x%08x stub!\n", iface, color);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetColorRGB(IDirect3DRMFrame *iface,
+        D3DVALUE red, D3DVALUE green, D3DVALUE blue)
+{
+    FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
+
+    return E_NOTIMPL;
+}
+
+static D3DRMZBUFFERMODE WINAPI d3drm_frame1_GetZbufferMode(IDirect3DRMFrame *iface)
+{
+    FIXME("iface %p stub!\n", iface);
+
+    return D3DRMZBUFFER_FROMPARENT;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetMaterialMode(IDirect3DRMFrame *iface, D3DRMMATERIALMODE mode)
+{
+    FIXME("iface %p, mode %#x stub!\n", iface, mode);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetOrientation(IDirect3DRMFrame *iface, IDirect3DRMFrame *reference,
+        D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
+{
+    FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
+        iface, reference, dx, dy, dz, ux, uy, uz);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetPosition(IDirect3DRMFrame *iface,
+        IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
+{
+    FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetRotation(IDirect3DRMFrame *iface,
+        IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
+{
+    FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
+        iface, reference, x, y, z, theta);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetSortMode(IDirect3DRMFrame *iface, D3DRMSORTMODE mode)
+{
+    FIXME("iface %p, mode %#x stub!\n", iface, mode);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture *texture)
+{
+    FIXME("iface %p, texture %p stub!\n", iface, texture);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetTextureTopology(IDirect3DRMFrame *iface, BOOL wrap_u, BOOL wrap_v)
+{
+    FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetVelocity(IDirect3DRMFrame *iface,
+        IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
+{
+    FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
+        iface, reference, x, y, z, with_rotation);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_SetZbufferMode(IDirect3DRMFrame *iface, D3DRMZBUFFERMODE mode)
+{
+    FIXME("iface %p, mode %#x stub!\n", iface, mode);
+
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI d3drm_frame1_Transform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
+{
+    FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
+
+    return E_NOTIMPL;
+}
+
+static const struct IDirect3DRMFrameVtbl d3drm_frame1_vtbl =
+{
+    d3drm_frame1_QueryInterface,
+    d3drm_frame1_AddRef,
+    d3drm_frame1_Release,
+    d3drm_frame1_Clone,
+    d3drm_frame1_AddDestroyCallback,
+    d3drm_frame1_DeleteDestroyCallback,
+    d3drm_frame1_SetAppData,
+    d3drm_frame1_GetAppData,
+    d3drm_frame1_SetName,
+    d3drm_frame1_GetName,
+    d3drm_frame1_GetClassName,
+    d3drm_frame1_AddChild,
+    d3drm_frame1_AddLight,
+    d3drm_frame1_AddMoveCallback,
+    d3drm_frame1_AddTransform,
+    d3drm_frame1_AddTranslation,
+    d3drm_frame1_AddScale,
+    d3drm_frame1_AddRotation,
+    d3drm_frame1_AddVisual,
+    d3drm_frame1_GetChildren,
+    d3drm_frame1_GetColor,
+    d3drm_frame1_GetLights,
+    d3drm_frame1_GetMaterialMode,
+    d3drm_frame1_GetParent,
+    d3drm_frame1_GetPosition,
+    d3drm_frame1_GetRotation,
+    d3drm_frame1_GetScene,
+    d3drm_frame1_GetSortMode,
+    d3drm_frame1_GetTexture,
+    d3drm_frame1_GetTransform,
+    d3drm_frame1_GetVelocity,
+    d3drm_frame1_GetOrientation,
+    d3drm_frame1_GetVisuals,
+    d3drm_frame1_GetTextureTopology,
+    d3drm_frame1_InverseTransform,
+    d3drm_frame1_Load,
+    d3drm_frame1_LookAt,
+    d3drm_frame1_Move,
+    d3drm_frame1_DeleteChild,
+    d3drm_frame1_DeleteLight,
+    d3drm_frame1_DeleteMoveCallback,
+    d3drm_frame1_DeleteVisual,
+    d3drm_frame1_GetSceneBackground,
+    d3drm_frame1_GetSceneBackgroundDepth,
+    d3drm_frame1_GetSceneFogColor,
+    d3drm_frame1_GetSceneFogEnable,
+    d3drm_frame1_GetSceneFogMode,
+    d3drm_frame1_GetSceneFogParams,
+    d3drm_frame1_SetSceneBackground,
+    d3drm_frame1_SetSceneBackgroundRGB,
+    d3drm_frame1_SetSceneBackgroundDepth,
+    d3drm_frame1_SetSceneBackgroundImage,
+    d3drm_frame1_SetSceneFogEnable,
+    d3drm_frame1_SetSceneFogColor,
+    d3drm_frame1_SetSceneFogMode,
+    d3drm_frame1_SetSceneFogParams,
+    d3drm_frame1_SetColor,
+    d3drm_frame1_SetColorRGB,
+    d3drm_frame1_GetZbufferMode,
+    d3drm_frame1_SetMaterialMode,
+    d3drm_frame1_SetOrientation,
+    d3drm_frame1_SetPosition,
+    d3drm_frame1_SetRotation,
+    d3drm_frame1_SetSortMode,
+    d3drm_frame1_SetTexture,
+    d3drm_frame1_SetTextureTopology,
+    d3drm_frame1_SetVelocity,
+    d3drm_frame1_SetZbufferMode,
+    d3drm_frame1_Transform,
+};
+
 static HRESULT WINAPI d3drm_frame2_QueryInterface(IDirect3DRMFrame2 *iface, REFIID riid, void **out)
 {
     struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
@@ -1190,12 +1859,15 @@ static HRESULT WINAPI d3drm_frame3_QueryInterface(IDirect3DRMFrame3 *iface, REFI
 
     TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
 
-    if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2)
-            || IsEqualGUID(riid, &IID_IDirect3DRMFrame)
+    if (IsEqualGUID(riid, &IID_IDirect3DRMFrame)
             || IsEqualGUID(riid, &IID_IDirect3DRMObject)
             || IsEqualGUID(riid, &IID_IDirect3DRMVisual)
             || IsEqualGUID(riid, &IID_IUnknown))
     {
+        *out = &frame->IDirect3DRMFrame_iface;
+    }
+    else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2))
+    {
         *out = &frame->IDirect3DRMFrame2_iface;
     }
     else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
@@ -2280,6 +2952,7 @@ HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown *parent, IUnknown **out)
     if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
         return E_OUTOFMEMORY;
 
+    object->IDirect3DRMFrame_iface.lpVtbl = &d3drm_frame1_vtbl;
     object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
     object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
     object->ref = 1;
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c
index 5cd6a11..f922d77 100644
--- a/dlls/d3drm/tests/d3drm.c
+++ b/dlls/d3drm/tests/d3drm.c
@@ -2559,6 +2559,7 @@ static void test_frame_qi(void)
     IDirect3DRMFrame *frame1;
     IDirect3DRMFrame2 *frame2;
     IDirect3DRMFrame3 *frame3;
+    IDirect3DRMObject *obj;
     IUnknown *unknown;
 
     hr = Direct3DRMCreate(&d3drm1);
@@ -2592,6 +2593,15 @@ static void test_frame_qi(void)
     test_qi("frame3_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests));
     IUnknown_Release(unknown);
 
+    hr = IDirect3DRM_CreateFrame(d3drm1, NULL, &frame1);
+    ok(SUCCEEDED(hr), "Cannot get IDirect3DRMFrame interface (hr = %#x).\n", hr);
+
+    hr = IDirect3DRMFrame_QueryInterface(frame1, &IID_IDirect3DRMObject, (void **)&obj);
+    ok(SUCCEEDED(hr), "Could not get IDirect3DRMObject interface (hr = %#x).\n", hr);
+    ok(obj == (IDirect3DRMObject *)frame1, "got object pointer %p, expected %p", obj, frame1);
+    IDirect3DRMObject_Release(obj);
+    IDirect3DRMFrame_Release(frame1);
+
     IDirect3DRM3_Release(d3drm3);
     IDirect3DRM2_Release(d3drm2);
     IDirect3DRM_Release(d3drm1);
-- 
2.3.2 (Apple Git-55)




More information about the wine-patches mailing list