IDXGIFactory2::GetSharedResourceAdapterLuid method (dxgi1_2.h)

Identifies the adapter on which a shared resource object was created.

Syntax

HRESULT GetSharedResourceAdapterLuid(
  [in]  HANDLE hResource,
  [out] LUID   *pLuid
);

Parameters

[in] hResource

A handle to a shared resource object. The IDXGIResource1::CreateSharedHandle method returns this handle.

[out] pLuid

A pointer to a variable that receives a locally unique identifier (LUID) value that identifies the adapter. LUID is defined in Dxgi.h. An LUID is a 64-bit value that is guaranteed to be unique only on the operating system on which it was generated. The uniqueness of an LUID is guaranteed only until the operating system is restarted.

Return value

GetSharedResourceAdapterLuid returns:

Platform Update for Windows 7:  On Windows 7 or Windows Server 2008 R2 with the Platform Update for Windows 7 installed, GetSharedResourceAdapterLuid fails with E_NOTIMPL. For more info about the Platform Update for Windows 7, see Platform Update for Windows 7.

Remarks

You cannot share resources across adapters. Therefore, you cannot open a shared resource on an adapter other than the adapter on which the resource was created. Call GetSharedResourceAdapterLuid before you open a shared resource to ensure that the resource was created on the appropriate adapter. To open a shared resource, call the ID3D11Device1::OpenSharedResource1 or ID3D11Device1::OpenSharedResourceByName method.

Examples

HANDLE handle;
IDXGIFactory2* pFactory;

LUID luid;
pFactory->GetSharedResourceAdapterLuid (handle, &luid);

UINT index = 0;
IDXGIAdapter* pAdapter = NULL;
while (SUCCEEDED(pFactory->EnumAdapters(index, &pAdapter)))
{
    DXGI_ADAPTER_DESC desc;
    pAdapter->GetDesc(&desc);
    if (desc.AdapterLuid == luid)
    {
       // Identified a matching adapter.
       break;
    }
    pAdapter->Release();
    pAdapter = NULL;
    index++;
}
// At this point, if pAdapter is non-null, you identified an adapter that 
// can open the shared resource.

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header dxgi1_2.h
Library Dxgi.lib

See also

IDXGIFactory2