http://bugs.winehq.org/show_bug.cgi?id=18490
--- Comment #9 from naur mig21@static.int.pl 2010-05-15 21:08:20 --- I've investigated this issue again, this time in "Napoleon: Total War". It turns out, that IDirect3D9::createDevice method has different behaviour in Windows and Wine, when the device is created with desktop as focus window (GetWindowDesktop() handle passed in hFocusWindow argument). The Windows version of this method succeeds if D3DDEVTYPE_NULLREF or D3DDEVTYPE_REF device type is requested (and fails for other types). The Wine version of this method will always fail, regardless of the requested device type.
Note that Windows fails to perform actual rendering on devices created in that way. Hovewer, such device can still be used to perform some tasks, like loading textures in a worker thread (as described in this post: http://discussms.hosting.lsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind0606C&L=DIRE... ).
I'm not really sure what's the best way to handle this situation. Perhaps Wine should create a dummy window for reference and null reference D3D9 devices?