On Windows, FindDevice is only able to find those devices that EnumDevices lists for that Direct3D version. Here's the test program I wrote showing the result of FindDevice for each device:
https://pastebin.mozilla.org/8849627
- IDirect3D:
- IDirect3DRampDevice: 0x00000000
- IDirect3DRGBDevice: 0x00000000
- IDirect3DHALDevice: 0x00000000
- IDirect3DMMXDevice: 0x887600FF
- IDirect3DRefDevice: 0x887600FF
- IDirect3DNullDevice: 0x887600FF
- IDirect3DTnLHalDevice: 0x887600FF
- IDirect3D2:
- IDirect3DRampDevice: 0x00000000
- IDirect3DRGBDevice: 0x00000000
- IDirect3DHALDevice: 0x00000000
- IDirect3DMMXDevice: 0x00000000
- IDirect3DRefDevice: 0x887600FF
- IDirect3DNullDevice: 0x887600FF
- IDirect3DTnLHalDevice: 0x887600FF
- IDirect3D3:
- IDirect3DRampDevice: 0x887600FF
- IDirect3DRGBDevice: 0x00000000
- IDirect3DHALDevice: 0x00000000
- IDirect3DMMXDevice: 0x887600FF
- IDirect3DRefDevice: 0x887600FF
- IDirect3DNullDevice: 0x887600FF
- IDirect3DTnLHalDevice: 0x887600FF
(where 0x887600FF means DDERR_NOTFOUND.) This holds for every VM tested by WineTestBot (Windows 2000 through Windows 10).
Are we interested in replicating this behavior?
Currently, the FindDevice test in tests/d3d.c (which uses Direct3D1) explicitly checks that the MMX, Ref, TnlHal, and Null devices are not found. But since our implementation of CreateDevice (unlike Windows) already accepts any device regardless of the Direct3D version, it seems like we might as well report it through FindDevice.
I guess there is one catch: the current comments for D3D7EnumTest say that some games (Delta Force LW and C&C TFD) break if EnumDevices enumerates the T&L HAL device but not the ordinary HAL device. There might be a similar problem for FindDevice. It might be worth simply adding a small check for that.