Must copy static const D3DVERTEXELEMENT9 into dynamically alllocated D3DVERTEXELEMENT9 * before pointer passed correctly in Wine?

misha680 misha680 at gmail.com
Mon Sep 6 19:55:56 CDT 2010


Dear All:

Sorry to bother... I am working on a D3DXCreateMesh/ID3DXMesh patch, and I
encountered a very strange error.

Specifically, it seems that when passing a LPD3DVERTEXELEMENT9 * parameter
to D3DXCreateMesh, 
a) in Windows - one can create 

    static const D3DVERTEXELEMENT9 decl1[3] = {
        {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,
D3DDECLUSAGE_POSITION, 0},
        {0, 0xC, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,
D3DDECLUSAGE_NORMAL, 0},
        D3DDECL_END(), };

and pass (LPD3DVERTEXELEMENT9 *)&decl1 directly.

b) in Wine tests - I must first allocate a D3DVERTELEMENT9 *, then call
HeapAlloc, and finally copy my original decl1 and pass &decl (pointer to
newly allocated structure) for it to work. Any ideas?

Here is my git diff
http://wine.1045685.n5.nabble.com/file/n2805542/patch patch 

Thx
Misha
-- 
View this message in context: http://wine.1045685.n5.nabble.com/Must-copy-static-const-D3DVERTEXELEMENT9-into-dynamically-alllocated-D3DVERTEXELEMENT9-before-pointe-tp2805542p2805542.html
Sent from the Wine - Devel mailing list archive at Nabble.com.



More information about the wine-devel mailing list