DCompositionCreateSurfaceHandle function

Creates a new composition surface object that can be bound to a Microsoft DirectX swap chain or swap buffer and associated with a visual.

Syntax

HRESULT DCompositionCreateSurfaceHandle(
  DWORD               desiredAccess,
  SECURITY_ATTRIBUTES *securityAttributes,
  HANDLE              *surfaceHandle
);

Parameters

desiredAccess

Type: DWORD

The requested access to the composition surface object. It can be one of the following values:

Value Meaning
0x0000L
No access.
COMPOSITIONSURFACE_READ
0x0001L
Read access. For internal use only.
COMPOSITIONSURFACE_WRITE
0x0002L
Write access. For internal use only.
COMPOSITIONSURFACE_ALL_ACCESS
0x0003L
Read/write access. Always specify this flag except when duplicating a surface in another process, in which case set desiredAccess to 0.

securityAttributes

Type: SECURITY_ATTRIBUTES*

Contains the security descriptor for the composition surface object, and specifies whether the handle of the composition surface object is inheritable when a child process is created. If this parameter is NULL, the composition surface object is created with default security attributes that grant read and write access to the current process, but do not enable child processes to inherit the handle.

surfaceHandle

Type: HANDLE*

The handle of the new composition surface object. This parameter must not be NULL.

Return Value

Type: HRESULT

If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. See DirectComposition Error Codes for a list of error codes.

Requirements

   
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header dcomp.h
Library Dcomp.lib
DLL Dcomp.dll