On Tue, May 17, 2016 at 1:04 AM, Stefan Dösinger <stefandoesinger@gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Am 2016-05-13 um 22:21 schrieb Aaryaman Vasishta:
>  static HRESULT WINAPI d3drm_texture1_InitFromFile(IDirect3DRMTexture *iface, const char *filename)
>  {
> -    FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename));
> +    struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface);
> +    D3DRMIMAGE *image;
> +    HRESULT hr;
>
> -    return E_NOTIMPL;
> +    TRACE("iface %p, filename %s.\n", iface, debugstr_a(filename));
> +
> +    if (texture->image)
> +    {
> +        /* d3drm intentionally leaks a reference IDirect3DRM if texture is already initialized. */
> +        IDirect3DRM_AddRef(texture->d3drm);
> +        return D3DRMERR_BADOBJECT;
> +    }
> +    if (FAILED(hr = d3drm_texture_load(texture, filename, FALSE, &image)))
> +        return hr;
> +
> +    hr = IDirect3DRMTexture3_InitFromImage(&texture->IDirect3DRMTexture3_iface, image);
I think you forgot to remove the extra check here :-) . (https://www.winehq.org/pipermail/wine-devel/2016-May/113212.html)
Right, my bad. I was a bit sloppy in checking version 1 after making changes to version 3. I'll be extra careful next time :)

> -    IDirect3DRM_AddRef(texture->d3drm);
> +    if (texture->d3drm)
> +        IDirect3DRM_AddRef(texture->d3drm);
This if check looks like it is an accidental leftover from before you reordered patch 1 too.
Thanks for catching this! I'll remove it in the resend.

Cheers,
Aaryaman