Gives a device access to a shared resource that is referenced by name and that was created on a different device. You must have previously created the resource as shared and specified that it uses NT handles (that is, you set the D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag).
public:
HRESULT OpenSharedResourceByName(
LPCWSTR lpName,
DWORD dwDesiredAccess,
REFIID returnedInterface,
void **ppResource
)
lpName
Type: LPCWSTR
[in]
The name of the resource to open. This parameter cannot be NULL.
dwDesiredAccess
Type: DWORD
[in]
The requested access rights to the resource. In addition to the generic access rights, Microsoft DirectX Graphics Infrastructure (DXGI) defines the following values:
You can combine values by using a bitwise OR operation.
returnedInterface
Type: REFIID
[in] The globally unique identifier (GUID) for the resource interface. For more info, see Remarks.
ppResource
Type: void **
[out] A pointer to a variable that receives a pointer to the interface for the shared resource object to access.
Type: HRESULT
This method returns one of the Direct3D 11 return codes. This method also returns E_ACCESSDENIED if the permissions to access the resource aren’t valid.
The behavior of OpenSharedResourceByName is similar to the behavior of the ID3D11Device1::OpenSharedResource1 method; each call to OpenSharedResourceByName to access a resource creates a new resource object. In other words, if you call OpenSharedResourceByName twice and pass the same resource name to lpName, you receive two resource objects with different IUnknown pointers.
Header: Declared in d3d11_x.h (d3d11_1.h on other Windows platforms).
Library: Use d3d11_x.lib (d3d11.lib on other Windows platforms).