<br><br><div class="gmail_quote">2012/4/17 Michael Stefaniuc <span dir="ltr"><<a href="mailto:mstefani@redhat.com">mstefani@redhat.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 04/17/2012 09:46 PM, Marcus Meissner wrote:<br>
> On Tue, Apr 17, 2012 at 09:10:45PM +0200, Christian Costa wrote:<br>
</div><div class="im">>> Patch <a href="http://source.winehq.org/patches/data/85420" target="_blank">http://source.winehq.org/patches/data/85420</a> is marked as<br>
>> pending. I've taken a look but I still don't understand what's<br>
>> wrong.<br>
>> Is there anything I've missed ?<br>
><br>
> I stopped reading at this line:<br>
><br>
> + � � � �*frame = (LPDIRECT3DRMFRAME)(&impl_from_IDirect3DRMFrame3(This->parent)->IDirect3DRMFrame2_iface);<br>
><br>
> You are doing something very wrong if you need to cast this way.<br>
</div>That's just the stupid obfuscation introduced by using LPDIRECT3DRMFRAME<br>
instead of (IDirect3DRMFrame *) and then the cast might be plausible<br>
(e.g. a function taking an IFace* type but which is implemented by the<br>
IFace2 interface).<br>
<br></blockquote><div><br>Yes that's exactly the case.<br>�</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
There are three other issues with that line though that kill it:<br>
- For type safety reasons impl_from_IFace() needs to be used *only* in<br>
variable declarations.<br></blockquote><div><br>Ok. Does not seem to be explicit on the COM guidelines. Could you make it more explicit on the wiki ?<br>�<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

- Calling impl_from_IFace() on interface pointers outside methods that<br>
implement that interface are verboten.<br></blockquote><div><br>Same as above.<br>�<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
- Both above points can be completely avoided by making the parent field<br>
be "IDirect3DRMFrameImpl *parent".<br></blockquote><div><br>Ok. I will do that.<br>�<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div class="im"><br></div></blockquote></div><br>Christian<br><br>