D3DKMT_CREATEALLOCATIONFLAGS structure

The D3DKMT_CREATEALLOCATIONFLAGS structure identifies how to create an allocation in a call to the D3DKMTCreateAllocation function.

Syntax

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;
#if ...
  UINT Zeroed : 1;
  UINT WriteWatch : 1;
  UINT StandardAllocation : 1;
  UINT ExistingSection : 1;
#if ...
  UINT Reserved : 14;
#elif
  UINT Reserved : 16;
#elif
  UINT Zeroed : 1;
#elif
  UINT Reserved : 20;
#else
  UINT Zeroed : 1;
#endif
#else
  UINT Reserved : 25;
#endif
} D3DKMT_CREATEALLOCATIONFLAGS;

Members

CreateResource

A UINT value that specifies whether to create a device-specific resource.

If you set CreateShared, you must also set CreateResource.

Setting this member is equivalent to setting the first bit of a 32-bit value (0x00000001).

CreateShared

A UINT value that 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.

Setting this member is equivalent to setting the second bit of a 32-bit value (0x00000002).

NonSecure

A UINT value that 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.

Setting this member is equivalent to setting the third bit of a 32-bit value (0x00000004).

CreateProtected

This member is reserved and should be set to zero. Setting this member is equivalent to setting the fourth bit of a 32-bit value (0x00000008).

Supported starting with Windows 7.

RestrictSharedAccess

A UINT value that specifies whether to create a resource shared across all devices but with some restrictions.

Setting this member is equivalent to setting the fifth bit of a 32-bit value (0x00000010).

Supported starting with Windows 7.

ExistingSysMem

This member is reserved and should be set to zero. Setting this member is equivalent to setting the sixth bit of a 32-bit value (0x00000020).

Supported starting with Windows 7.

NtSecuritySharing

A UINT value that specifies whether the allocation is shared with an NT handle, meaning that it does not have a global D3DKMT_HANDLE kernel-mode handle to the resource.

If NtSecuritySharing is set to 1 (TRUE), the allocation is shared using the D3DKMTShareObjects function but does not have a global D3DKMT_HANDLE handle to the resource.

Note  If NtSecuritySharing is set to 1, CreateShared must be set to 1.
 
For more information on using NtSecuritySharing, see the Remarks section.

Setting this member is equivalent to setting the seventh bit of a 32-bit value (0x00000040).

Supported starting with Windows 8.

ReadOnly

A UINT value that specifies whether the allocation can only be read from.

Setting this member is equivalent to setting the eighth bit of a 32-bit value (0x00000080).

Supported starting with Windows 8.

CreateWriteCombined

This member is reserved and should be set to zero. Setting this member is equivalent to setting the seventh bit of a 32-bit value (0x00000100).

Supported starting with Windows 8.

CreateCached

This member is reserved and should be set to zero. Setting this member is equivalent to setting the eighth bit of a 32-bit value (0x00000200).

Supported starting with Windows 8.

SwapChainBackBuffer

This member is reserved and should be set to zero. Setting this member is equivalent to setting the seventh bit of a 32-bit value (0x00000100).

Supported starting with Windows 8.

CrossAdapter

The cross adapter.

OpenCrossAdapter

The open cross adapter. Can't be used when allocation is created from the user mode.

PartialSharedCreation

Zeroed

WriteWatch

StandardAllocation

ExistingSection

Reserved

Supported starting with Windows 8.

This member is reserved and should be set to zero. Setting this member is equivalent to setting the remaining 26 bits (0xFFFFFFC0) of a 32-bit value to zeros.

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:

  • If the allocation is not shared, set both CreateShared and NtSecuritySharing to 0.
  • If the allocation is shared with a D3DKMT_HANDLE data type, set CreateShared = 1 and NtSecuritySharing = 0.
  • If the allocation is shared with an NT handle to the process (and without a global D3DKMT_HANDLE kernel-mode handle to the resource), set CreateShared = 1 and NtSecuritySharing = 1.

Requirements

   
Minimum supported client Available in Windows Vista and later versions of the Windows operating systems.
Header d3dkmthk.h (include D3dkmthk.h)

See also

D3DKMTCreateAllocation

D3DKMT_CREATEALLOCATION