D3DKMT_CREATEALLOCATION structure (d3dkmthk.h)
The D3DKMT_CREATEALLOCATION structure describes parameters for creating allocations.
Syntax
typedef struct _D3DKMT_CREATEALLOCATION {
[in] D3DKMT_HANDLE hDevice;
[in/out] D3DKMT_HANDLE hResource;
[out] D3DKMT_HANDLE hGlobalShare;
[in] const VOID *pPrivateRuntimeData;
[in] UINT PrivateRuntimeDataSize;
union {
[in] D3DKMT_CREATESTANDARDALLOCATION *pStandardAllocation;
[in] const VOID *pPrivateDriverData;
};
[in/out] UINT PrivateDriverDataSize;
[in] UINT NumAllocations;
union {
[in] D3DDDI_ALLOCATIONINFO *pAllocationInfo;
[in] D3DDDI_ALLOCATIONINFO2 *pAllocationInfo2;
};
[in] D3DKMT_CREATEALLOCATIONFLAGS Flags;
[in] HANDLE hPrivateRuntimeResourceHandle;
} D3DKMT_CREATEALLOCATION;
Members
[in] hDevice
A handle to the device that the resource or allocation is associated with.
[in/out] hResource
A D3DKMT_HANDLE data type that represents a kernel-mode handle to the resource that is associated with the allocations. The value in hResource should always be zero unless an allocation will be added to an existing resource, in which case hResource contains the resource handle.
When the CreateResource bit-field flag is set in the Flags member, the OpenGL runtime generates a unique handle and passes it back to the driver. On output from the D3DKMTCreateAllocation function, hResource specifies the handle that the driver should use in subsequent OpenGL runtime calls to identify the resource. The resource handle that is returned is device-specific and is valid only when used with the device that it was created on.
[out] hGlobalShare
A user-mode client driver should not share resources using global handles. The driver should set NtSecuritySharing in Flags and call D3DKMTShareObjects to get an NT handle. Using global handles is not secure. Any process can guess a global handle and open a shared object. Global handles are supported only for compatibility reasons with old D3D runtimes. (When NtSecuritySharing isn't set, the global handle is returned in hGlobalShare. Nothing prevents a UMD from sharing a resource using a global handle, but drivers shouldn't do that.)
[in] pPrivateRuntimeData
A pointer to optional private data that can be attached to a resource for debugging purposes. This data is per resource and not per allocation.
[in] PrivateRuntimeDataSize
The size, in bytes, of the private data that pPrivateRuntimeData points to.
[in] pStandardAllocation
Pointer to a D3DKMT_CREATESTANDARDALLOCATION structure that describes the standard allocation to be created.
[in] pPrivateDriverData
A pointer to a buffer that contains optional private data that the display miniport driver might require to create the resource or allocation. The contents of the buffer typically come from the ICD and must be in a format that the display miniport driver can process.
[in/out] PrivateDriverDataSize
The size, in bytes, of the private data that pPrivateDriverData points to.
[in] NumAllocations
The number of elements in the array that pAllocationInfo specifies, which represents the number of allocations to create. Note that creating a resource without any allocations initially associated with it is valid; therefore, NumAllocations can be set to 0.
[in] pAllocationInfo
An array of D3DDDI_ALLOCATIONINFO structures that describe specific properties for each allocation to create.
[in] pAllocationInfo2
This member is reserved and should be set to zero.
This member is available beginning with Windows 7.
[in] Flags
A D3DKMT_CREATEALLOCATIONFLAGS structure that identifies attributes for creating the allocation, in bit-field flags.
If you set the CreateShared bit-field flag in Flags, you must also set the CreateResource bit-field flag.
[in] hPrivateRuntimeResourceHandle
An opaque handle that you can use in event tracing. This handle can be used to associate kernel-mode allocations with user-mode surface pointers when you analyze Event Tracing for Windows (ETW) event logs.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Header | d3dkmthk.h (include D3dkmthk.h) |