Patch 85420

Michael Stefaniuc mstefani at
Tue Apr 17 15:39:31 CDT 2012

On 04/17/2012 09:46 PM, Marcus Meissner wrote:
> On Tue, Apr 17, 2012 at 09:10:45PM +0200, Christian Costa wrote:
>> Patch 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).

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.
- Calling impl_from_IFace() on interface pointers outside methods that
implement that interface are verboten.
- Both above points can be completely avoided by making the parent field
be "IDirect3DRMFrameImpl *parent".

> It probably also needs explicit sign-off drom the d3d folks as it handles funny refcounting.
Not really, this is plain COM stuff.


More information about the wine-devel mailing list