Rémi Bernon (@rbernon) commented about dlls/win32u/tests/d3dkmt.c:
+ if (d3d11_imp && GET_API(test) <= 3) + { + hr = ID3D11Device1_OpenSharedResourceByName( d3d11_imp, name, GENERIC_ALL, &IID_ID3D11Resource, (void **)&import_d3d11 ); + ok_hr( S_OK, hr ); + } + + if (d3d12_imp && GET_API(test) <= 3) + { + HANDLE other = 0; + + hr = ID3D12Device_OpenSharedHandleByName( d3d12_imp, name, GENERIC_ALL, &other ); + ok_hr( S_OK, hr ); + + hr = ID3D12Device_OpenSharedHandle( d3d12_imp, other, &IID_ID3D12Resource, (void **)&import_d3d12 ); + ok_hr( S_OK, hr ); + if (other) CloseHandle( other ); There's `open_d3d12_named_shared_handle` now to do this.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9526#note_122930