IDXGIFactory2::GetSharedResourceAdapterLuid method

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

Syntax


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

Parameters

hResource [in]

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

pLuid [out]

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.

Windows Phone 8: This API is supported.

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

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Header

DXGI1_2.h

Library

Dxgi.lib

See also

IDXGIFactory2

 

 

Community Additions

ADD
Show:
© 2014 Microsoft