D3DKMT_CREATEALLOCATIONFLAGS - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// d3dkmthk.h

typedef struct _D3DKMT_CREATEALLOCATIONFLAGS {
  UINT CreateResource : 1;
  UINT CreateShared : 1;
  UINT NonSecure : 1;
  UINT CreateProtected : 1;
  UINT RestrictSharedAccess : 1;
  UINT ExistingSysMem : 1;
  UINT NtSecuritySharing : 1;
  UINT ReadOnly : 1;
  UINT CreateWriteCombined : 1;
  UINT CreateCached : 1;
  UINT SwapChainBackBuffer : 1;
  UINT CrossAdapter : 1;
  UINT OpenCrossAdapter : 1;
  UINT PartialSharedCreation : 1;
  UINT Zeroed : 1;
  UINT WriteWatch : 1;
  UINT StandardAllocation : 1;
  UINT ExistingSection : 1;
  UINT AllowNotZeroed : 1;
  UINT PhysicallyContiguous : 1;
  UINT NoKmdAccess : 1;
  UINT SharedDisplayable : 1;
  UINT NoImplicitSynchronization : 1;
#if ...
  UINT Reserved : 9;
#elif
  UINT Reserved : 10;
#elif
  UINT Reserved : 11;
#elif
  UINT Reserved : 13;
#elif
  UINT Reserved : 14;
#elif
  UINT Reserved : 16;
#elif
  UINT Reserved : 21;
#else
  UINT Reserved : 26;
#endif
} D3DKMT_CREATEALLOCATIONFLAGS;
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (ns-d3dkmthk-_d3dkmt_createallocationflags)

Description

D3DKMT_CREATEALLOCATIONFLAGS is a structure of bit fields that specify how to create an allocation in a call to the D3DKMTCreateAllocation function.

Members

CreateResource

Specifies whether to create a device-specific resource. If you set CreateShared, you must also set CreateResource.

CreateShared

Specifies whether to create a resource shared across all devices. If you set CreateShared, you must also set CreateResource. For more information on using CreateShared, see the Remarks section.

NonSecure

Specifies whether to create an allocation that can be opened by any process. If NonSecure is set, secure and non-secure processes can open the allocation.

CreateProtected

This member is reserved and should be set to zero. Supported starting with Windows 7.

RestrictSharedAccess

Specifies whether to create a resource shared across all devices but with some restrictions. Supported starting with Windows 7.

ExistingSysMem

This member is reserved and should be set to zero. Supported starting with Windows 7. ExistingSysMem's limitations follow:

    D3DKMDT_GDISURFACEDATA::Width = Size of ExistingSysMem buffer
    D3DKMDT_GDISURFACEDATA::Height = 1
    D3DKMDT_GDISURFACEDATA::Format = D3DDDIFMT_UNKNOWN
    D3DKMDT_GDISURFACEDATA::Type = D3DKMDT_GDISURFACE_TEXTURE_CROSSADAPTER
   

NtSecuritySharing

Specifies whether the allocation is shared with an NT handle, meaning that it doesn't have a global D3DKMT_HANDLE kernel-mode handle to the resource.

If NtSecuritySharing is set to 1 (TRUE):

For more information on using NtSecuritySharing, see the Remarks section. Supported starting with Windows 8.

ReadOnly

Specifies whether the allocation can only be read from. Supported starting with Windows 8.

CreateWriteCombined

This member is reserved and should be set to zero. Supported starting with Windows 8.

CreateCached

This member is reserved and should be set to zero. Supported starting with Windows 8.

SwapChainBackBuffer

This member is reserved and should be set to zero. Supported starting with Windows 8.

CrossAdapter

If set, indicates that the resource is a shared cross-adapter resource.

OpenCrossAdapter

If set, indicates that the resource is created by opening a cross adapter resource. Can't be used when allocation is created from the user mode. Supported starting with Windows 8.1 (WDDM 1.3).

PartialSharedCreation

Specifies whether the allocation is created as a partial shared allocation. Supported starting with Windows 8.1 (WDDM 1.3).

Zeroed

[out] Set when the allocation was fulfilled with zeroed pages. Supported starting with Windows 8 (WDDM 1.3).

WriteWatch

[in] Indicates whether to create the allocation with write-watch enabled. Supported starting with Windows 8.1 (WDDM 1.3).

StandardAllocation

[in] When set, instructs Dxgkrnl to create a standard allocation using pStandardAllocation instead of pPrivateDriverData. Either ExistingSysMem or ExistingSection (but not both) must also be set if StandardAllocation is set. Additionally, when creating a StandardAllocation, the CreateShared and CrossAdapter flags must also be set. Supported starting with Windows 10 version 1709 (WDDM 2.3).

ExistingSection

[in] When set, instructs Dxgkrnl to use the section handle (hSection) instead of the system memory pointer (pSystemMem). ExistingSystemMem and ExistingSection can't both be set for the same allocation. If ExistingSection is set, StandardAllocation must also be set. Supported starting with Windows 10 version 1709 (WDDM 2.3).

AllowNotZeroed

[in] Indicates that the allocation can be created without zeroing the pages. Supported starting with Windows 10, version 1903 (WDDM 2.6).

PhysicallyContiguous

[in] Indicates that the allocation must be physically contiguous. Supported starting with Windows 10, version 2004 (WDDM 2.7).

NoKmdAccess

[in] Indicates that the KMD isn't notified about the allocation. Supported starting with Windows 10, version 2004 (WDDM 2.7).

SharedDisplayable

Indicates that the allocation is a shared, displayable resource. Supported starting with Windows 11 (WDDM 3.0).

Reserved

Supported starting with Windows 8.

This member is reserved and should be set to zero.

Remarks

Objects to be shared by using the D3DKMTShareObjects function must first be created with the NtSecuritySharing flag value set. This flag value is available in the D3DKMT_CREATEALLOCATIONFLAGS, D3DKMT_CREATEKEYEDMUTEX2_FLAGS, and D3DDDI_SYNCHRONIZATIONOBJECT_FLAGS structures.

Drivers should follow these guidelines on D3DKMT_CREATEALLOCATIONFLAGS sharing flags:

See also

D3DKMTCreateAllocation

D3DKMT_CREATEALLOCATION