Bewerken

Delen via


DXGKDDI_MIRACAST_CREATE_CONTEXT callback function (dispmprt.h)

Creates a kernel-mode context for a Miracast device.

Syntax

DXGKDDI_MIRACAST_CREATE_CONTEXT DxgkddiMiracastCreateContext;

NTSTATUS DxgkddiMiracastCreateContext(
  [in]  PVOID DriverContext,
  [in]  DXGK_MIRACAST_DISPLAY_CALLBACKS *MiracastCallbacks,
  [out] PVOID *MiracastContext,
  [out] ULONG *TargetId
)
{...}

Parameters

[in] DriverContext

A handle to a context block that is associated with a display adapter. The display miniport driver's DxgkDdiAddDevice function previously provided this handle to the DirectX graphics kernel subsystem.

[in] MiracastCallbacks

A pointer to an operating system-provided buffer that holds a DXGK_MIRACAST_DISPLAY_CALLBACKS structure that has pointers to callback functions that the driver can call.

[out] MiracastContext

A pointer to an operating system-provided buffer that holds the address of the context that the driver allocated for this Miracast device instance.

[out] TargetId

A pointer to an operating system-provided buffer that holds the ID of the VidPN target that the Miracast device is connected to. The driver should report this target as type D3DKMDT_VOT_MIRACAST when the operating system calls the DxgkDdiQueryChildRelations function during device initialization.

Return value

Returns STATUS_SUCCESS if it succeeds. Otherwise, it returns one of the error codes that are defined in Ntstatus.h, including:

Return code Description
STATUS_RESOURCE_IN_USE The hardware resources needed to support a Miracast connected session aren't currently available.

Remarks

When this function is called, the display miniport driver should prepare all kernel-mode resources that it needs to support a Miracast connected session.

Synchronization

The operating system groups the DxgkDdiMiracastCreateContext, DxgkDdiMiracastDestroyContext, and DxgkDdiMiracastIoControl functions as a Miracast class. The operating system guarantees that these functions follow the second-level synchronization mode as defined in Threading and Synchronization Second Level. These functions can be called when other level 0, 1, or other classes of level 2 functions are being called on another thread context. However, only one of these level 2 Miracast-class functions can be called at a time.

Requirements

Requirement Value
Minimum supported client Windows 8.1
Minimum supported server Windows Server 2012 R2
Target Platform Desktop
Header dispmprt.h (include Dispmprt.h)
IRQL PASSIVE_LEVEL

See also

DXGK_MIRACAST_DISPLAY_CALLBACKS

DxgkDdiAddDevice

DxgkDdiQueryChildRelations