On Mon, Apr 18, 2016 at 4:17 PM, Henri Verbeet <hverbeet@gmail.com> wrote:
On 17 April 2016 at 22:57, Aaryaman Vasishta <jem456.vasishta@gmail.com> wrote:
> @@ -1054,10 +1058,50 @@ static ULONG WINAPI d3drm3_Release(IDirect3DRM3 *iface)
>  static HRESULT WINAPI d3drm3_CreateObject(IDirect3DRM3 *iface,
>          REFCLSID clsid, IUnknown *outer, REFIID iid, void **out)
>  {
> -    FIXME("iface %p, clsid %s, outer %p, iid %s, out %p stub!\n",
> +    void *object_struct;
...
> +    if (IsEqualGUID(clsid, &CLSID_CDirect3DRMTexture))
> +    {
> +        if (FAILED(hr = d3drm_texture_create((struct d3drm_texture **)&object_struct)))
> +        {
> +            *out = NULL;
> +            return hr;
> +        }
> +        object = (IUnknown *)&((struct d3drm_texture *)object_struct)->IDirect3DRMTexture3_iface;
> +    }
Why do you need "object_struct"?
I need it to store the object's address, from which the IUnknown interface is obtained which in turn is used to QI the required object using iid.

Am I missing something? Is there a better way? I suppose I could re-use object and keep it as a void * instead of IUnknown..

Cheers,
Aaryaman