Elizabeth Figura (@zfigura) commented about dlls/d3d9/tests/device.c:
- d3d9on12 = (void *)0xdeadbeef;
- hr = create_d3d9on12_device(&d3d9, window, &override_list, override_entries, &device, TRUE);
- if (FAILED(hr))
- {
skip("Failed to create a regular Direct3DDevice9, skipping d3d9on12 tests\n");
goto out;
- }
- hr = IDirect3DDevice9_QueryInterface(device, &IID_IDirect3DDevice9On12, (void **)&d3d9on12);
- ok(hr == S_OK, "Got hr %#lx.\n", hr);
- hr = IDirect3DDevice9On12_GetD3D12Device(d3d9on12, &IID_ID3D12Device, (void **)&d3d12device_2);
- todo_wine
- ok(hr == S_OK, "Got hr %#lx.\n", hr);
- todo_wine
- ok(override_list.pD3D12Device == (IUnknown *)d3d12device_2, "GetD3D12Device returned device %p, expected %p\n", d3d12device_2, override_list.pD3D12Device);
Should GetD3D12Device() reference the returned device? If so we should release it.
The documentation doesn't say, but you can probably test by making sure to release the device at the end of the function, and checking if its refcount reaches zero.