2012/4/17 Michael Stefaniuc <mstefani@redhat.com>
On 04/17/2012 09:46 PM, Marcus Meissner wrote:
> On Tue, Apr 17, 2012 at 09:10:45PM +0200, Christian Costa wrote:
>> Patch http://source.winehq.org/patches/data/85420 is marked as
>> pending. I've taken a look but I still don't understand what's
>> wrong.
>> Is there anything I've missed ?
>
> I stopped reading at this line:
>
> +        *frame = (LPDIRECT3DRMFRAME)(&impl_from_IDirect3DRMFrame3(This->parent)->IDirect3DRMFrame2_iface);
>
> You are doing something very wrong if you need to cast this way.
That's just the stupid obfuscation introduced by using LPDIRECT3DRMFRAME
instead of (IDirect3DRMFrame *) and then the cast might be plausible
(e.g. a function taking an IFace* type but which is implemented by the
IFace2 interface).


Yes that's exactly the case.
 
There are three other issues with that line though that kill it:
- For type safety reasons impl_from_IFace() needs to be used *only* in
variable declarations.

Ok. Does not seem to be explicit on the COM guidelines. Could you make it more explicit on the wiki ?
 
- Calling impl_from_IFace() on interface pointers outside methods that
implement that interface are verboten.

Same as above.
 
- Both above points can be completely avoided by making the parent field
be "IDirect3DRMFrameImpl *parent".

Ok. I will do that.
 


Christian