Am 10.01.2019 um 11:16 schrieb Józef Kucia <joseph.kucia@gmail.com>:

+    hr = ID3D12Device_CreateFence(device, 0, D3D12_FENCE_FLAG_NONE,
+            &IID_ID3D12Fence, (void **)&test_object);
+    ok(hr == S_OK, "Failed to create fence, hr %#x.\n", hr);
If you create your own IUnknown vtable and block in the AddRef or Release methods you may be able to test the locking by d3d12 better than by relying on race conditions. Of course if native is clever it will AddRef before holding the lock and manipulating its data, and call Release after removing the private data and releasing the lock. But I know that ddraw to d3d9 don't do that, and haven't tested d3d10/11.