DXGKDDI_CREATEDEVICE callback function

The DxgkDdiCreateDevice function creates a graphics context device that is subsequently used in calls to the display miniport driver's device-specific functions.

Syntax

DXGKDDI_CREATEDEVICE DxgkddiCreatedevice;

NTSTATUS DxgkddiCreatedevice(
  IN_CONST_HANDLE hAdapter,
  INOUT_PDXGKARG_CREATEDEVICE pCreateDevice
)
{...}

Parameters

hAdapter

[in] A handle to a context block that is associated with a display adapter. The display miniport driver previously provided this handle to the Microsoft DirectX graphics kernel subsystem in the MiniportDeviceContext output parameter of the DxgkDdiAddDevice function.

pCreateDevice

[in/out] A pointer to a DXGKARG_CREATEDEVICE structure that describes the graphics context device.

Return Value

DxgkDdiCreateDevice returns one of the following values:

Return code Description
STATUS_SUCCESS DxgkDdiCreateDevice successfully created the graphics context device.
STATUS_NO_MEMORY DxgkDdiCreateDevice could not allocate memory that was required for it to complete.

Remarks

The DirectX graphics kernel subsystem calls the display miniport driver's DxgkDdiCreateDevice function to create a graphics context device that the graphics subsystem subsequently passes in calls to the display miniport driver. The driver uses a device to hold a collection of rendering state. The graphics subsystem can create multiple devices in the same process on a given graphics processing unit (GPU) adapter.

Note  The number of devices that can simultaneously exist is limited only by available system memory. That is, a driver cannot have a hard-coded maximum device limit.
 
Generally, devices are independent of each other; in other words, resources that are created in one device cannot be referenced or accessed by resources that are created in another device. However, cross-process resources are an exception to this rule.

DxgkDdiCreateDevice should be made pageable.

Requirements

   
Minimum supported client Available in Windows Vista and later versions of the Windows operating systems.
Target Platform Desktop
Header d3dkmddi.h
IRQL PASSIVE_LEVEL

See Also

DXGKARG_CREATEDEVICE

DxgkDdiAddDevice