On 3/25/20 3:27 AM, Henri Verbeet wrote:
On Tue, 24 Mar 2020 at 12:22, Zhiyi Zhang zzhang@codeweavers.com wrote:
/* Detaching adapter shouldn't reduce the adapter count */
expected_adapter_count = adapter_count;
adapter_count = IDirect3D8_GetAdapterCount(d3d);
ok(adapter_count == expected_adapter_count,
"Adapter %u: Got unexpected adapter count %u, expected %u.\n", i, adapter_count,
expected_adapter_count);
monitor = IDirect3D8_GetAdapterMonitor(d3d, i);
ok(!monitor, "Adapter %u: Expect monitor to be NULL.\n", i);
Not an issue with this patch, but this does raise the possibility that some of the earlier checks in this test may not be correct for the case where a monitor was detached prior to running the test.
If a monitor is detached prior to d3d instantiation, then it's not enumerated. Only attached monitors are enumerated during d3d initialization. So this case could only happen when a monitor is attached before d3d instantiation, and then the monitor gets detached while d3d is still in use. I think this is also verified by the earlier checks in this test.
Thanks, Zhiyi