<br><br><div class="gmail_quote">2012/10/25 Nikolay Sivov <span dir="ltr"><<a href="mailto:bunglehead@gmail.com" target="_blank">bunglehead@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 10/25/2012 10:34, Christian Costa wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
+<br>
+static HRESULT WINAPI ID3DXFileDataImpl_Create(<u></u>IDirectXFileObject *dxfile_object, ID3DXFileData **ret_iface)<br>
+{<br>
+ � �ID3DXFileDataImpl *object;<br>
+<br>
+ � �TRACE("(%p, %p)\n", dxfile_object, ret_iface);<br>
+<br>
+ � �*ret_iface = NULL;<br>
+<br>
+ � �object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));<br>
+ � �if (!object)<br>
+ � �{<br>
+ � � � �ERR("Out of memory\n");<br>
+ � � � �return E_OUTOFMEMORY;<br>
+ � �}<br>
+<br>
+ � �object->ID3DXFileData_iface.<u></u>lpVtbl = &ID3DXFileData_Vtbl;<br>
+ � �object->ref = 1;<br>
+ � �object->dxfile_object = (IDirectXFileData*)dxfile_<u></u>object;<br>
+<br>
+ � �*ret_iface = &object->ID3DXFileData_iface;<br>
+<br>
+ � �return S_OK;<br>
+}<br>
+<br>
</blockquote></div></div>
You don't need WINAPI for it.<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
� + � � � �ret = ID3DXFileDataImpl_Create((<u></u>IDirectXFileObject*)data_<u></u>object, &object->children[object->nb_<u></u>children]);<br>
</blockquote></div>
It seems you're casting it back and forth, is it possible to use proper type for data_object?</blockquote><div>�</div><div>Because in another serie�ID3DXFileDataImpl_Create will be called in another place with a FileObject and�ID3DXFileDataImpl_Create</div>
<div>will really deals with that FileObject.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ � �{<br>
+ � � � �(&object->ID3DXFileEnumObject_<u></u>iface)->lpVtbl->Release(&<u></u>object->ID3DXFileEnumObject_<u></u>iface);<br>
</blockquote></div>
Hmm, what's wrong with object->ID3DXFileEnumObject_<u></u>iface.lpVtbl->Release ?<br></blockquote><div>What do you mean ?�</div></div><br>