Copy and tidy up the code from dx8 create device into wined3d. Call from wined3d and d3d8, but short term only use the code for real from d3d9.