DXGKDDI_MIRACAST_HANDLE_IO_CONTROL回调函数 (dispmprt.h)

由作系统调用以请求显示微型端口驱动程序处理同步 I/O 控制请求,以响应对 MiracastIoControl 函数的用户模式显示驱动程序调用。

语法

DXGKDDI_MIRACAST_HANDLE_IO_CONTROL DxgkddiMiracastHandleIoControl;

NTSTATUS DxgkddiMiracastHandleIoControl(
  [in]  PVOID DriverContext,
  [in]  PVOID MiracastContext,
  [in]  ULONG InputBufferSize,
  [in]  VOID *pInputBuffer,
  [in]  ULONG OutputBufferSize,
  [out] VOID *pOutputBuffer,
  [out] ULONG *BytesReturned
)
{...}

参数

[in] DriverContext

与显示适配器关联的上下文块的句柄。 显示微型端口驱动程序的 DxgkDdiAddDevice 函数以前向 DirectX 图形内核子系统提供了此句柄。

[in] MiracastContext

由作系统提供的 Miracast 设备上下文。 此上下文是由显示微型端口驱动程序在调用 DxgkDdiMiracastCreateContext 函数时提供的。

[in] InputBufferSize

由作系统提供的输入缓冲区的大小(以字节为单位),pInputBuffer所指向。 此值源自 MiracastIoControl 函数的 InputBufferSize 参数的用户模式。

[in] pInputBuffer

由作系统作为指向输入缓冲区的指针提供。 此值源自 MiracastIoControl 函数的 InputBufferSize 参数的用户模式。

InputBufferSize 指定缓冲区的大小。

[in] OutputBufferSize

由作系统提供为 由 pOutputBuffer指向的输出缓冲区的大小(以字节为单位)。

此值源自 miracastIoControl 函数的 OutputBufferSize 参数的用户模式

[out] pOutputBuffer

由作系统作为指向输出缓冲区的指针提供。 此值源自用户模式 MiracastIoControl 函数的 pOutputBuffer 参数。

OutBufferSize 指定缓冲区的大小。

[out] BytesReturned

由作系统作为指向缓冲区的指针提供,该缓冲区包含 ULONG类型值,该值是 pOutputBuffer指向的缓冲区中返回的显示微型端口驱动程序的字节数。

返回值

如果成功,则返回 STATUS_SUCCESS。 否则,它将返回 Ntstatus.h 中定义的错误代码之一。

言论

作系统保证调用 DxgkDdiMiracastIoControl 与调用 MiracastIoControl MiracastIoControl 请求相同的进程空间。

尽管作系统仅从 MiracastIoControl的相应参数复制输入和输出缓冲区大小的值,但显示微型端口驱动程序在使用缓冲区之前负责检查缓冲区大小。 此外,驱动程序应在 try/except 调用块内执行探测作,使用 ProbeForRead 和/或 ProbeForWrite 函数来验证输入缓冲区指向的任何用户模式内存。

此 I/O 控制作通过调用用户模式 MiracastIoControl 函数同步处理。

同步

作系统将 DxgkDdiMiracastCreateContextDxgkDdiMiracastDestroyContextDxgkDdiMiracastIoControl 函数作为 Miracast 类。

此函数的线程和同步级别由用户模式驱动程序在调用 MiracastIoControl 函数时如何设置 HardwareAccess 参数来设置:

  • 如果 HardwareAccessFALSE,则作系统保证 DxgkDdiMiracastIoControl 遵循 线程和同步二级中定义的二级同步模式。 当在其他线程上下文上调用其他级别 0、1 或非 Miracast 类时,可以调用 dxgkDdiMiracastIoControl。 但是,一次只能调用级别 2 Miracast 类函数之一。
  • 如果 HardwareAccessTRUE,则 DxgkDdiMiracastIoControl 遵循 线程和同步第三级中定义的第三级同步模式。 请注意,GPU 的刷新将产生大量的处理开销。

要求

要求 价值
最低支持的客户端 Windows 8.1
支持的最低服务器 Windows Server 2012 R2
目标平台 桌面
标头 dispmprt.h (包括 Dispmprt.h)
IRQL PASSIVE_LEVEL

另请参阅

DxgkDdiAddDevice

DxgkDdiMiracastCreateContext

MiracastIoControl

ProbeForRead

ProbeForWrite