IDisplayDeviceInterop::OpenSharedHandle method (windows.devices.display.core.interop.h)

Opens a handle for shared primary surfaces, shared fences, and source presentation handles.

Syntax

HRESULT OpenSharedHandle(
  HANDLE NTHandle,
  IID    riid,
  void   **ppvObj
);

Parameters

NTHandle

Type: HANDLE

An NT handle for a shared primary surface, shared fence, or source presentation handle.

riid

Type: REFIID

A reference to the interface identifier (IID) for the default interface of one of the following Windows Runtime classes. An IID is a GUID.

ppvObj

Type: void**

A pointer to a memory block that receives a pointer to the interface specified by the riid argument.

Return value

Type: HRESULT

Returns S_OK on success, or a failure code describing the problem on failure.

Remarks

You can use this method to open any shared fence, but you can open a surface only if it was created as primary. Primary surfaces are surfaces intended to be used directly by the display hardware to scan out. Most typical Direct3D surfaces are not created as primaries unless they were created for use in a swap-chain back buffer. DisplayDevice.CreatePrimary always creates a surface as a primary, since it is always intended to be used to scan out.

Opening a source presentation handle is similar to calling CreateScanoutSource for the target of the presentation handle, except that it isn't necessary to have created the DisplayDevice from the same DisplayManager that created the handle. This allows fine-grained access control of scanout.

Requirements

Requirement Value
Minimum supported client Windows 10 Build 20348
Minimum supported server Windows 10 Build 20348
Target Platform Windows
Header windows.devices.display.core.interop.h
Library d3d12.lib
DLL d3d12.dll

See also